• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 darkgreen, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post darkgreen  
            Started by GTBrooks, Today, 02:44 PM
            2 responses
            14 views
            0 likes
            Last Post GTBrooks  
            Started by GLFX005, Today, 12:22 PM
            4 responses
            41 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by AspenHiker, Today, 08:37 AM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by MartinT, Yesterday, 01:12 PM
            3 responses
            17 views
            0 likes
            Last Post MartinT
            by MartinT
             
            Working...
            X