Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        4 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        40 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X