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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      647 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X