Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not recognized as valid boolena

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Not recognized as valid boolena

    I'm reading parameters in to a strategy, based on what I learned in the SampleReadWrite indicator. I basically have it working, but if I try to read in a bool, I get this error message:

    String was not recognized as a valid Boolean

    My code looks like this:

    else if (splitCounter == 16 )
    {
    kciOn = bool.Parse(s);
    }

    and the text file uses 'true' and 'false' (lower case, sans the quote marks). I also tried the first letter of each as upper case. If I only do int and double parsing, everything works perfect.

    Any ideas what might be going on here?

    #2
    Hello coolmoss,

    What do you get if you Print() the string(s) that you are try to set the boolean?

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      My bad, I just discovered I had a typo, over 80 lines of parameters, which is why I want to automate this Thank you so much for prompt reply.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      157 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      91 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      143 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X