• 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 webus, Today, 02:03 AM
            0 responses
            7 views
            0 likes
            Last Post webus
            by webus
             
            Started by momchi, Yesterday, 07:12 PM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_ChrisSch  
            Started by DieSlower, Yesterday, 11:02 PM
            0 responses
            5 views
            0 likes
            Last Post DieSlower  
            Started by gujungg, Yesterday, 10:59 PM
            0 responses
            13 views
            0 likes
            Last Post gujungg
            by gujungg
             
            Started by DieSlower, Yesterday, 09:46 PM
            0 responses
            13 views
            0 likes
            Last Post DieSlower  
            Working...
            X