Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting No Trades

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

    Backtesting No Trades

    Hey guys,

    I am connected to BarChart for data. My strategy runs from 7 am to 2 pm and excludes the weekends. When I backtest the data on CL I have no problems. When I backtested on NG there were no trades placed. I didn't believe this to be possible so I pulled up a chart of NG and ran the strategy that way. I ran the strategy on the chart with no time or date filters and it placed 100's of trades, but when I edit the properties for the chart and made it 7:00 am to 2:00 pm and exclude the weekends all the trades disappear.

    I've got the trace orders on and the output window only puts up one entry after the whole backtest that says it's cancelling all orders at the end of the chart.

    I turned the strat on live and it also did not place any trades when it should have.

    Thanks

    Shiptastic

    #2
    You need to debug it. Start from a case you know where it works and slowly add layers of complexity.

    Please see this tip: http://www.ninjatrader-support2.com/...ead.php?t=3418
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      I've debugged the code pretty well. Obviously not well enough, however what I'm looking for is if there are any known bugs or issues that might affect a strategy based on the Start time and End time it is given. The code works perfectly with CL from 7 am to 2 pm, but not NG. I just tried NG from 6:55 am to 2:00 pm and it works. I don't think that is something in the code. But if you can offer any insight at all into what might be affected by start and end time let me know.

      Thanks

      Shiptastic

      Comment


        #4
        Hi shiptastic,

        Are you using any variables specific for one market, like TickSize for example? The time settings could affect the calculation of indicators and breakout levels...did you plot them from the strategy and checked for the basic signals to be in line with the trading logic you had in mind? How about other common markets like ES or YM?

        If you post code, we can have a more specific look...
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Actually I did use tick size. I wonder if that could be it. I plot the indicators and have printed them in the output window to double check their accuracy and everything looks good there.

          I've attached the code as a text file, wasn't sure how else to do it.

          Shiptastic
          Attached Files

          Comment


            #6
            shiptastic,

            Strategies are always affected by your chart start/end times. The strategies always calculate based on what is on the chart. This includes indicators and everything.

            I suggest you start simple and slowly add layers of complexity until you find where it is breaking. Unfortunately we just cannot debug your code for you. You can also try using a real time filter instead of limiting your chart start/end times because that influences the calculations of your strategy: http://www.ninjatrader-support2.com/...ead.php?t=3226
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh,

              Awesome thank you for the very helpful link. I will use that.

              Shiptastic

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,605 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              8 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              4 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              13 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X