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

Optimization show up issues

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

    Optimization show up issues

    I having some of the StrategyBaseConverter to help me display some properties based on some condition.

    For example, if we choose SMA, then it will show up another properties and then user can fill up.

    However, I noticed that in the optimization, the value didnt show up.
    Once i Command out the StrategyBaseConverter, it show up again.

    Any idea help me to solve this ??

    Or else, can you give me the code to access the strategy analyzer -> backtest type --> optimization so that i can make a condition in my StrategyBaseConverter there

    #2
    Hello cincai,

    Thanks for the post.

    Before I try this on my end I wanted to clarify, did you mean "once I Command comment out" as in removing the StrategyBaseConverter from your strategy class and returning to a standard strategy?

    Also what specifically is not showing up? The properties or the values of those properties, or the whole strategy?

    I am not certain if the backtest category can be used from the base converter, you can certainly check if that's going to help with your specific use case. You can detect the optimization like the following:

    Code:
    if (State == State.Configure)
    {
        if (Category == Category.Backtest)
          Print("Strategy is running a regular backtest ");
       else if (Category == Category.Optimize)
          Print("Strategy is running an optimization ");
       else if (Category == Category.WalkForward)
          Print("Strategy is running walk forward optimization");
       else if (Category == Category.MultiObjective)
          Print("Strategy is running a multi objective optimization ");
       else if (Category == Category.NinjaScript)
          Print("Strategy is running on an account from a chart/strategies tab ");
    }
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks, it work

      Comment


        #4
        Can i know is that
        Category == Category.Backtest only can used in strategy ??

        Because I used it is indicator, and it appear error to me

        Comment


          #5
          Hello cincai,

          That's correct, that is a strategy only property. Only strategies can be selected in the analyzer.


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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by appasri, 08-12-2022, 09:17 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by ArmKnuckle, Yesterday, 11:04 PM
          0 responses
          6 views
          0 likes
          Last Post ArmKnuckle  
          Started by mcrathb, Yesterday, 10:37 PM
          0 responses
          5 views
          0 likes
          Last Post mcrathb
          by mcrathb
           
          Started by joshuaburnett91, Yesterday, 09:13 AM
          4 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by set2win, Yesterday, 08:51 AM
          2 responses
          18 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X