• 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

Back testing showing no trades when I know there are trades to take

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

    Back testing showing no trades when I know there are trades to take

    I have written a simple pullback strategy that works perfectly on market replay data and LIVE Sim. When I attempt to back test on a day I know there are trades (taken from replay), the back testing shows NO TRADES. Can someone offer an opinion as to why this is happening. I am using managed entries/exits not ATM. The sample crossover strategy provided by NT works in back test mode. I would be happy to upload the strategy but my first thought I am missing something basis. I have never used the back test mode before now.
    Last edited by sarasotavince; 06-12-2019, 03:05 PM.

    #2
    Hello sarasotavince,

    Are you currently using CalculateOnBarClose = true or false in realtime?

    Can you also test if you able to see results on a more granular series such as 1 minute? Based on the description alone, I would guess this has to do with the logic you have used and the daily bars being used. If your condition to trade is not becoming true on daily bars in historical but is in realtime, that would lead me to the CalculateOnBarClose property and how historical data processes.

    You generally will see differences between historical and realtime testing due to the way the script calculates in each use case.


    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      I am using CalculateOnBarClose = true; and 1 minute bars. I am also using a "session time" logic that allows me to take trades between whatever times I choose, for example 10 am to 2pm only. New thoughts?

      Comment


        #4
        Hello sarasotavince,

        Thank you for the additional details.

        If you are using CalculateOnBarClose = true, that is what the backtest will also use so that would not likely be the problem. From the other details, I couldn't really say what may be the cause other than you are likely using some property which equates differently in historical/realtime.

        Using Print statements would most likely be the best way to find the problem in the logic for this question. At this point I would need to see a sample of the syntax used to better understand what may be used here that is preventing the test from placing trades.

        Because you are using historical data, do you currently have both 1 minute and daily bars for the entire range you are testing? Have you tried a short test of just a few months?

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          So ends the mystery. When I test new code on Replay Data and do not want to see anything that happens BEFORE I start my replay, I use the code:
          Code:
          if (Historical)
          return;
          (Don't we all do this?) It never occurred to me to rem these lines out before running the back test -- again thinking the data would start 12:00am of the selected day for the back test. So silly.

          Nonetheless, thanks for your input. It helped.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by akitenge, 06-14-2019, 02:54 PM
          4 responses
          27 views
          0 likes
          Last Post chartish  
          Started by siriusm, Today, 09:15 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Started by Duval, Today, 09:27 AM
          2 responses
          8 views
          0 likes
          Last Post Duval
          by Duval
           
          Started by chazyang, Today, 08:11 AM
          2 responses
          9 views
          0 likes
          Last Post chazyang  
          Started by Erwin Beckers, 11-04-2018, 02:39 AM
          6 responses
          79 views
          2 likes
          Last Post koganam
          by koganam
           
          Working...
          X