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 gentlebenthebear, Today, 01:30 AM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by PhillT, Today, 02:16 PM
          2 responses
          6 views
          0 likes
          Last Post PhillT
          by PhillT
           
          Started by Kaledus, Today, 01:29 PM
          3 responses
          10 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frankthearm, Yesterday, 09:08 AM
          14 responses
          47 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by PaulMohn, Today, 12:36 PM
          2 responses
          17 views
          0 likes
          Last Post PaulMohn  
          Working...
          X