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

Strategy does not work on Analyzer, but it is Working on Real Time and Playback

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

    Strategy does not work on Analyzer, but it is Working on Real Time and Playback

    Hello,

    Can you please help me?

    I tested a strategy for working properly on playback and demo. I am trying to run it on the analyzer for review and optimization, and sometimes, it does not provide any results, or the results are a couple of entries that do not reflect the strategy's performance (it usually triggers eight signals per day).

    I have many prints checking the work. Also, no errors are shown on the log. I have no idea what else I can do. The only thing is that I am using delayed data because I do not have the instrument on my plan.

    Thank you for being always there!


    #2
    Hello Jorge.andres.o,

    Thank you for your post.

    To get a better understanding of why nothing happens when you test in the Strategy Analyzer, please answer all of the following questions:
    • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
    • Do you see similar results when running the same test on the SampleMACrossOver strategy in NinjaTrader with the same settings as your strategy?
    • Who are you connected to? This is displayed in green in the lower-left corner of the Control Center window.
    • Are you connected to your data feed provider when running this test?
    • What instrument(s) (and expiry if applicable) have you selected?
    • What Data Series Type have you selected? Example: Tick, Minute, Day
    • What From and To date is selected?
    • If you open a chart for the same instrument(s) and the same date range, then right-click the chart and select 'Reload all historical data' is the historical data showing on the chart?
    • Is your strategy a multi-instrument or multi-time frame strategy?
    • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

    I look forward to assisting further.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
      8.1.2.1 64-bit
      • Do you see similar results when running the same test on the SampleMACrossOver strategy in NinjaTrader with the same settings as your strategy?
      Other strategies work properly.
      • Who are you connected to? This is displayed in green in the lower-left corner of the Control Center window.
      I am connected to the end of the day and my kinetic plan. I have not paid for MNQ and there is a message that the data is delayed 15 minutes.
      • Are you connected to your data feed provider when running this test?
      Yes.
      • What instrument(s) (and expiry if applicable) have you selected?
      MNQ Mar24
      • What Data Series Type have you selected? Example: Tick, Minute, Day
      21 minutes for the chart. The strategy runs with multiple timeframes: 1 tick, 7 minutes, 1 day.
      • What From and To date is selected?
      It does not work properly regardless of the dates from and to that I set.
      • If you open a chart for the same instrument(s) and the same date range, then right-click the chart and select 'Reload all historical data' is the historical data showing on the chart?
      Yes, it shows the option.
      • Is your strategy a multi-instrument or multi-time frame strategy?
      It is multi-time frame. The strategy runs on 21 minutes and does calculations on 1 Tick, 7 minutes, 1 day.
      • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?
      No errors at all. The strategy works well on market replay, historical data, and sim101.

      Comment


        #4
        Hello Jorge.andres.o,

        What dates specifically have you been testing? It would be helpful to determine if there is enough historical data in order for the backtest to be run on the dates you are using. If you are using NinjaTrader as your data provider, the amount of available historical data is generally:
        • Tick data: About a year
        • Minute data: About 10 years
        • Daily data: Never removed
        • Market Replay data: Up to 90 days for the most popular Futures and Forex instruments


        ​If the strategy is getting data and the strategy is enabled or a backtest is run with no errors in the Log tab of the Control Center, and the Sample MA Crossover is returning results, then would likely indicate the logic conditions in the custom strategy did not evaluate as true or orders are being ignored or cancelled.

        In order to better understand how the code is working, it will be necessary to use Print to see how the conditions are evaluating and enable TraceOrders to see if orders are being submitted, ignored, rejected, or cancelled.

        Below is a link to a forum post that demonstrates using prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.


        It is also helpful to set TraceOrders to true in State.Configure as well as print the order object in OnOrderUpdate().

        TraceOrders will output to the NinjaScript Output window a message when orders are being submitted, ignored, cancelled, or rejected.

        Printing the order object in OnOrderUpdate() will allow you to track the progression of the order from submitted, to working, to filled, cancelled, or rejected.

        These tools will let you know what happens to the order.
        TraceOrders - https://ninjatrader.com/support/help...raceorders.htm
        OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm

        Let me know if you need any assistance creating a print or enabling TraceOrders.

        Save the output from the output window to a text file and provide this with your reply.

        I'll be happy to assist with analyzing the output.​
        Gaby V.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        14 views
        0 likes
        Last Post strategist007  
        Working...
        X