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 rdtdale, Today, 01:02 PM
          0 responses
          3 views
          0 likes
          Last Post rdtdale
          by rdtdale
           
          Started by alifarahani, Today, 09:40 AM
          3 responses
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by RookieTrader, Today, 09:37 AM
          4 responses
          18 views
          0 likes
          Last Post RookieTrader  
          Started by PaulMohn, Today, 12:36 PM
          0 responses
          8 views
          0 likes
          Last Post PaulMohn  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          41 views
          0 likes
          Last Post love2code2trade  
          Working...
          X