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 GLFX005, Today, 03:23 AM
        0 responses
        1 view
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        14 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        3 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Working...
        X