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 Pattontje, Yesterday, 02:10 PM
          2 responses
          14 views
          0 likes
          Last Post Pattontje  
          Started by flybuzz, 04-21-2024, 04:07 PM
          17 responses
          229 views
          0 likes
          Last Post TradingLoss  
          Started by agclub, 04-21-2024, 08:57 PM
          3 responses
          17 views
          0 likes
          Last Post TradingLoss  
          Started by TradingLoss, 04-21-2024, 04:32 PM
          4 responses
          43 views
          2 likes
          Last Post TradingLoss  
          Started by cre8able, 04-17-2024, 04:16 PM
          6 responses
          56 views
          0 likes
          Last Post cre8able  
          Working...
          X