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

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 GussJ, 03-04-2020, 03:11 PM
            16 responses
            3,280 views
            0 likes
            Last Post Leafcutter  
            Started by WHICKED, Today, 12:45 PM
            2 responses
            19 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Started by Tim-c, Today, 02:10 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            5 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            53 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Working...
            X