Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting Clarification Please

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

    Backtesting Clarification Please

    Please see the attached screenshot of a backtest result for a single trade.

    Here is my question:

    Looking at the candle, how can the backtest assume that the trade would have completed as it is showing?

    How can it be sure which came first or in what order the data flowed? All we have is the O/H/L/C to work with and we only know the order which the macro occured and as such how can it assume that trade would have been successful?

    Or a shorter version to my question is... With all things being equal in that the data used for backtesting is clean and COBC = true, that my results would have been very similar or the same? Anyway, can I trust that result?

    The entry point is the right number, and the exit is the right number. My signal tells me to fade the currentbid() - x number of ticks, in this case it was 9. So how can the backtest know that this would have occurred in the order that benefited the trade.

    Looking at this candle/bar. It looks like it opened, and dropped straight down and then closed at the low. So how in the heck can the backtest assume I got filled, it bounced, but then closed lower??? Something isn't adding up.

    I'm tired, so excuse me if I am not asking the question right.
    Attached Files

    #2
    It's a fair question. In short...

    - There is no way to know on a bar which direction the market travelled to form the bar (as you pointed out)
    - Therefore, our current logic fills orders based on sequence they were submitted
    - In some cases (as per your image) you may get a positive result, in other cases you may get a negative result
    - Neither may be right or wrong however, statistically in a backtest it should not matter
    - We looked at providing option in NT7 to specify the direction the bar formed but we (at this time) decided its just trading one hypothetical for another so...nothing gained nothing lost
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray,

      What about having a way to look at a smaller time frame inside the candle to get a better gauge as to where price may have landed, etc.

      Also, I am running two DOMs, side by side right now. One is live with real cash, the other is sim.

      They are BOTH using the EXACT same strategy. They are BOTH on the exact same instrument.

      I am seeing orders fire on the live side, but I am not seeing as many or almost no orders on the sim side, even though they are identical.

      Can you give some insight as to why this may occur?

      UPDATE:
      Strange??

      Instead of loading the Strategy for the sim side on the chart, I took it down and added it to the strat tab directly and it seems to have put them a bit closer in sync.
      Last edited by r2kTrader; 06-23-2009, 07:30 AM.

      Comment


        #4
        r2kTrader,

        You can try backtesting with additional bar granularity as demonstrated in this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=6652

        I am not quite following you on the DOM comment. A NinjaScript strategy cannot run on a DOM. Are you talking about ATM strategies? Also, remember that filling on an actual account is going to be different than filling on a paper trading account. There are whole market dynamics that paper trading can only try to simulate, but actual trading may not necessarily be the same.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          r2kTrader,

          You can try backtesting with additional bar granularity as demonstrated in this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=6652

          I am not quite following you on the DOM comment. A NinjaScript strategy cannot run on a DOM. Are you talking about ATM strategies? Also, remember that filling on an actual account is going to be different than filling on a paper trading account. There are whole market dynamics that paper trading can only try to simulate, but actual trading may not necessarily be the same.
          No, rather I put the strategies on and then watched the orders on the DOM (as echoed from the Strategy) to see if they were aligned and they were.

          The granularity issue regarding backtesting looks like drama, lol. But I will look into it. As it stands, I spent a few bucks learning about the backtesting the hard way. I am starting to feel like backtesting is really worth zilch and you have to forward test in real time or with actual ticks.

          Comment


            #6
            r2kTrader,

            You will want to print output from your strategies to see when orders are placed instead of trying to see when they get filled.

            As far as backtesting goes, it provides you with just one possible outcome out of a whole range of possible outcomes. Backtesting and forward testing should always be taken with a grain of salt because there are always factors that just can't be simulated.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              r2kTrader,

              You will want to print output from your strategies to see when orders are placed instead of trying to see when they get filled.

              As far as backtesting goes, it provides you with just one possible outcome out of a whole range of possible outcomes. Backtesting and forward testing should always be taken with a grain of salt because there are always factors that just can't be simulated.
              I was watching the orders being placed in real time. Two DOMs, same instrument. Each linked to a different account, 1 live, 1 sim. In strategy tab, 2 of the exact same strategy running, each to a different account, 1 sim, 1 live.

              I then used te DOMs side by side to see if the orders for the simulated version of the strategy were in line/sync with the live version of the strategy.

              Comment


                #8
                DOMs will only show you filled entries and sitting orders that have been accepted. It will not show you the relevant information of when orders are actually submitted. Submitting and accepted/filled are different steps and you want to track the first step of the process not the second. To do this you will need to use Print() output directly from the strategies and only then can you ID what your orders are doing.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                646 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                367 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                107 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                569 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X