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 CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      44 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      135 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      189 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      99 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      141 views
      0 likes
      Last Post cmoran13  
      Working...
      X