Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Backtesting

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

    Strategy Backtesting

    Hello.

    I have just recently registered with ninjatrader, but I am having some trouble using it.

    I have a trial license, so I am unsure if this is causing the problem, so I hope someone could shed some light into this.

    I developed a sample strategy just as a proof of concept, but when I try to backtest it, nothing seems to happen. At least, from what I can see in the report, no trades seem to be opened and closed.

    This is my OnBarUpdate, I just want to open and close for the sake of the test:

    if (!entered) {
    EnterLong(100,"test");
    entered = true;
    }
    else {
    ExitLong();
    entered = false;
    }

    And my initialization is just this:

    protected override void Initialize() {
    CalculateOnBarClose = true;
    TraceOrders = true;
    Print("Strategy Initialized");
    }

    I have tried this with some S&P500 instruments, but the report always comes empty.

    Am I missing something here? Do I need to connect to some data feed? I am connected to 'Simulated Data Feed'. Is this not working because of the trial? Should I connect to some broker for this to work? If yes, how should I do this? Is there any tutorial on a step by step process for initializing Ninjatrader, with all the needed steps prior to being able to backtest a strategy?

    Thank you for your help.

    #2
    Hello blunt,

    Thank you for your post and welcome to the NinjaTrader Support Forum.

    What is the bool 'entered' originally set to in the variables? False?

    Do you see results when running the same test on the SampleMaCrossOver strategy in NinjaTrader with the same settings as your strategy?

    Are you connected to your data feed provider when running this test?

    Do you have data in the Historical Data Manager (Tools > Historical Data Manager) for the instrument and period you are testing the strategy on?

    I look forward to your response.

    Comment


      #3
      Hello.

      That variable is initially set to false.

      Regarding the sample strategies, I tried running them and none of them made any trades, so I assumed this was a limitation regarding the trial key.

      Regarding being connected to the data provider, I am unsure of what you mean, but I connected to the simulated data feed. Is this enough?

      I am not able to check the historical data manager, but I will verify this later to check if it has data or not, and get back with the result.

      Comment


        #4
        Hello blunt,

        Thank you for your response.

        You will need access to historical data in order to run backtests in NinjaTrader. Data Feed Providers are technologies that you connect to in NinjaTrader to recieve real-time and historical data. You will need to connect to a data feed provider in order to download historical data. For a list of Data Feed Providers supported in NinjaTrader and the data they provide please visit the following link: http://www.ninjatrader.com/support/h...rical_data.htm

        The Simulated Date Feed does not provide historical data, it is fake internally generated data used for simulation trading. For information on the Simulated Data Feed please visit the following link: http://www.ninjatrader.com/support/h...connection.htm

        For a video on the Simulated Data Feed please visit the following link: http://youtu.be/CrFQNzULD78

        For information on using the Strategy Analyzer for backtesting please visit the following link: http://www.ninjatrader.com/support/h...y_analyzer.htm

        Please let me know if I may be of further assistance.

        Comment


          #5
          Hello.

          Thank you for your help.

          Regarding the strategy analyzer information, I had already seen that link, and tried executing the steps mentioned, but maybe due to the fact that I was connecting to the simulated data feed, I was unable to backtest.

          The connectivity providers listed that have historical tick data provide that information freely, or is it paid by subscription or any other way? The thing is that I am a developer, not a trader, and I am interested in testing the strategies I develop before delivering them to my clients, and so I am not interested in paying for tick data (I would rather have a provider with limited time data). For what is mentioned in that link, it would appear that only Yahoo Finance provides free historical data, and only daily, which is insufficient for what I am after. Did I understand correcly? Is there any other way of achieving this?

          Thank you in advance for any insights.

          Best regards.

          Comment


            #6
            Hello blunt,

            Thank you for your response.

            You are correct on this matter. Google, Yahoo and Kinetick EOD (Free) supply EOD data but only daily intervals. I am not aware of a data feed provider that supplies free tick data. However, if you are interested in your options for data feed providers please send a note to sales[at]ninjatrader[dot]com and they will be able to answer any questions you may have on the data and markets available from each provider.

            Please let me know if I may be of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            661 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            375 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            110 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            579 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X