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

StrategyAnalyzer Exception : Order property has not been set

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

    StrategyAnalyzer Exception : Order property has not been set

    Hi,
    a strategy that runs fine on the chart is having problems in the Strategy Analyzer. It can be backtested, but if the Backtest type is set to Optimization, the following exception appears in orange in the Log tab.
    "Failed to load selected strategy ... The Order Property has not been set. Use the GetOrder method to get the value."

    I am not familiar with the GetOrder method and it is not in the help or the intellisense. Nor do I knowwhy it would be crashing.

    Please assist.
    Cheers,
    saltminer

    #2
    Hello saltminer,

    Based on the error, this seems that it could be related to properties being used. GetOrder is not a documented NinjaScript method, the only information I could locate on this is that it may be related to the DisplayAttribute you are using and is not specifically related to the Order object like a placed order.

    Would you be able to provide a sample script that demonstrates this problem so I can see what syntax is being used?

    If you have not yet reduced the code to find what controls this error, I would suggest doing that, possibly in an entirely new test script. This would just help cut out your proprietary logic or other items you don't want to share, this would also help illuminate the issue so we can both test to find an answer.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      FIXED:
      In the properties of each input parameter I included Order=n and that fixed it up. Strange; leaving it out works ok on charts and in backtest, but not in Optimise.
      saltminer

      Comment


        #4
        Hi NT,

        To give more info, I found the Order property for input variables to be required on bool type values, however, double and int will not require it.

        I suspect this is a bug. Please have a look and let us know.
        mrlogik
        NinjaTrader Ecosystem Vendor - Purelogik Trading

        Comment


          #5
          I agree. NinjaTrader, this is stil an issue, please take a look at it <3

          Comment


            #6
            Hello bboyle1234,

            If you have a specific problem with some syntax you are using you can post a sample so that we can review if the use case is valid. The original user that created this thread did not provide a sample as an attachment or code and also specified they solved the problem. It is currently unknown what problem was observed originally and if you are running into something similar, we would need a specific sample of a problem to be able to look into it.


            JesseNinjaTrader Customer Service

            Comment


              #7
              Hi Jesse,

              If you add this property to a NT strategy and try to run it through Optimization it will give the OP's error and eventually crash NinjaTrader


              This one will crash
              Code:
              [NinjaScriptProperty]
              [Display(Name="Enable Longs", GroupName="Parameters")]
              public bool EnableLongs { get; set; }
              This one will work (notice i've added Order=0)
              Code:
              [NinjaScriptProperty]
              [Display(Name="Enable Longs", GroupName="Parameters", Order=0)]
              public bool EnableLongs { get; set; }


              It only seems to need Order=n for booleans. Any other type i've used works fine without it

              Originally posted by NinjaTrader_Jesse View Post
              Hello bboyle1234,

              If you have a specific problem with some syntax you are using you can post a sample so that we can review if the use case is valid. The original user that created this thread did not provide a sample as an attachment or code and also specified they solved the problem. It is currently unknown what problem was observed originally and if you are running into something similar, we would need a specific sample of a problem to be able to look into it.

              Comment


                #8
                Hello cmdctrl,

                Thank you for providing that sample, I was able to see the problem and have reported this to development. The tracking ID for that request is NT-15421

                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bmartz, 03-12-2024, 06:12 AM
                5 responses
                33 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by Aviram Y, Today, 05:29 AM
                4 responses
                13 views
                0 likes
                Last Post Aviram Y  
                Started by algospoke, 04-17-2024, 06:40 PM
                3 responses
                28 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by cls71, Today, 04:45 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X