Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BackTesting

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

    BackTesting

    Hi,

    I am using the Strategy Analyser in Ninja 7 for the first time and nothing happened! that it returns no test data!
    ///
    ...
    ...
    ..

    protected override void OnBarUpdate()
    {
    double value=MACD(12, 26, 9).Diff[0];
    ThisMacd= value;
    if (Position.Quantity ==0 && value<0 && OpenOrder == null)
    {
    OpenOrder=EnterLong(10,"O_MACDLong");
    }
    if (Position.Quantity !=0 && value>0 && OpenOrder == null && CloseOrder==null)
    {
    if (ThisMacd*LastMacd>0 && ThisMacd<LastMacd)
    {
    CloseOrder=ExitLong("C_MACDLong","O_MACDLong");
    }
    }
    LastMacd=ThisMacd;

    }

    protected override void OnOrderUpdate(IOrder order)
    {
    if (OpenOrder != null && OpenOrder == order)
    {

    if (order.OrderState == OrderState.Filled)
    OpenOrder = null;
    }
    if (CloseOrder != null && CloseOrder == order)
    {

    if (order.OrderState == OrderState.Filled)
    CloseOrder = null;
    }
    }

    Thanks.

    #2
    Hello,
    I have tested this on my end and I do see trades submitted.
    What data provider are you connected to?
    What instrument and date range do you have selected?
    If you backtest the SampleMACrossover do you see trades submitted?
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your response!

      I'm connected with NinjaTrader Continuum (Demo).
      For test I use AAPL .Range :[2016-06-01 to 2016-06-17].
      No trades submitted with SampleMACrossover for me!

      Comment


        #4
        I use ZB 03-16 and it's work! I think it's a problem of data!

        Comment


          #5
          Hello,
          NinjaTrader Continuum does not provide data for stocks, only Futures and Index data. To backtest on stocks you will need to connect to a data provider that offers this data.
          I have provided a link below to our Help Guide that goes over understanding the data provided by various connectivity providers.

          http://www.ninjatrader.com/support/h...rical_data.htm
          Cody B.NinjaTrader Customer Service

          Comment


            #6
            Thanks for your response!

            Comment

            Latest Posts

            Collapse

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