Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bool name already in use

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

    Bool name already in use

    Using Strategy Builder, I just attempted to set a Boolean user input variable as "EnterLong", but I got an error message that the name was already in use. I did use that input variable for a different strategy. Do I have to use a new name for bool "EnterLong1, EnterLong2, ..." every time I want to use it, or is there a way to use the same Boolean condition in multiple strategies as long as the condition will be set to "true" in each case?

    #2
    Hello Bionian,

    Thank you for the post.

    This is because of a change with the newest update, you cannot use existing NinjaScript names as variable or script names. EnterLong and EnterShort are existing methods in NinjaScript so these do not make good variable names.

    For your use case you could use something like ShouldEnterLong or DoEnterLong as some options.

    If you used EnterLong as a variable name in a previous strategy it may have trouble being edited, I would be interested to know if you are able to edit the file. If you are not able to continue editing it or have difficulties in the old file please let me know and we can look into correcting that script.

    I look forward to being of further assistance.

    Comment


      #3
      Actually, I previously used "GoLong" and "GoShort". Hopefully those will be OK, because it is one of my best strategies so far.

      Comment


        #4
        Hello Bionian,

        Yes GoLong or GoShort would be fine, these are not used in NinjaScript currently. An easy way to check variable names would be to try to use them in the builder now that it has error handling for that, or do a quick search in the help guide: https://ninjatrader.com/support/helpGuides/nt8/
        If something specific comes up in the help guide with that name it more than likely won't be able to be used.


        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        66 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        141 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        76 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        47 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        51 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X