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 geddyisodin, 04-25-2024, 05:20 AM
            8 responses
            61 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            4 responses
            3,288 views
            1 like
            Last Post jgualdronc  
            Started by Option Whisperer, Today, 09:55 AM
            0 responses
            5 views
            0 likes
            Last Post Option Whisperer  
            Started by halgo_boulder, 04-20-2024, 08:44 AM
            2 responses
            22 views
            0 likes
            Last Post halgo_boulder  
            Started by mishhh, 05-25-2010, 08:54 AM
            19 responses
            6,189 views
            0 likes
            Last Post rene69851  
            Working...
            X