Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can strategy optimizer or backtester be accessed from an indicator?

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

    Can strategy optimizer or backtester be accessed from an indicator?

    I'm working on an indicator that gives buy/sell signals, and I would like to add a neat feature I have seen in some other Ninjatrader indicators: When the indicator is loaded, it backtests itself using parameters entered in the indicator settings and displays the trades and results on the screen. Is it possible to access Ninjatrader's backtesting engine from within an indicator? Or would it be necessary to code my own backtester in ninjascript in order to accomplish this? Same question applies to accessing Ninjatrader's strategy optimizer. Thanks in advance.

    #2
    GoldStandard, when a NinjaTrader strategy is loaded on a chart it does exactly what you describe. The backtested strategy plots the historical trades right there on the chart. Attached is a screenshot of a strategy applied to a chart.
    Attached Files
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thank you very much for the fast reply Austin. The indicator (that backtests itself upon loading) that I'm referring to is definitely an indicator not a strategy, and is loaded through the 'indicators' menu not the 'strategies' menu, so perhaps the creator of the indicator has managed to get a strategy to load as an indicator. Is this supposed to be possible?

      I also notice that it tallies up wins and losses and profit on the screen, unlike the strategies I have seen, which only show trade locations.

      I'm curious whether it is possible to leverage the ninja strategy tester for this from inside an indicator, or whether I would need to ask my programmer to write a new strategy tester script within the indicator.

      Same question applies to accessing the strategy optimizer from within an indicator so that it runs when the indicator is loaded. Is this possible to do?

      Originally posted by NinjaTrader_Austin View Post
      GoldStandard, when a NinjaTrader strategy is loaded on a chart it does exactly what you describe. The backtested strategy plots the historical trades right there on the chart. Attached is a screenshot of a strategy applied to a chart.

      Comment


        #4
        GoldStandard,

        It sounds like you have a custom indicator that was programmed to mimic the logic of a strategy. You will not be able to just drop that into the Strategy Analyzer and would need to ask the original author for a strategy version of that script.

        This applies to backtests, optimizations, etc.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Yes, its a custom indicator that mimics a strategy.

          I was just wondering if there was a way for a programmer attempting this to access or make use of the existing strategy tester code from within Ninjatrader, so that he doesn't have to write a backtester from scratch.

          Thanks for your help.

          Originally posted by NinjaTrader_Josh View Post
          GoldStandard,

          It sounds like you have a custom indicator that was programmed to mimic the logic of a strategy. You will not be able to just drop that into the Strategy Analyzer and would need to ask the original author for a strategy version of that script.

          This applies to backtests, optimizations, etc.

          Comment


            #6
            GoldStandard, there's no need to rewrite the Strategy Analyzer's backtest logic, you just have to convert the indicator trading decision display into strategy actions in the code (i.e. if indicator condtion1 > EnterLong() ).
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rhyminkevin, Yesterday, 04:58 PM
            5 responses
            62 views
            0 likes
            Last Post dp8282
            by dp8282
             
            Started by realblubb, Today, 09:28 AM
            0 responses
            2 views
            0 likes
            Last Post realblubb  
            Started by AaronKoRn, Yesterday, 09:49 PM
            1 response
            18 views
            0 likes
            Last Post Rikazkhan007  
            Started by ageeholdings, Today, 07:43 AM
            0 responses
            12 views
            0 likes
            Last Post ageeholdings  
            Started by pibrew, Today, 06:37 AM
            0 responses
            4 views
            0 likes
            Last Post pibrew
            by pibrew
             
            Working...
            X