Back Testing Accuracy with OHLC data

Discussion in 'Strategy Building' started by SimpleMeLike, Feb 23, 2017.

  1. Hello,

    I recently discovered my back testing software NinjaTrader only provides OHLC data for the bars in back test.

    I need to back test some 3 min bars strategies where my entry/stop loss / profit targets are calculated and may not be one of the four OHLC prices during the back test.

    If I back test this way with just OHLC my back test will be inaccurate, correct?

    You have any suggestions or recommendations for this.

    Thank you
     
  2. Please clarify why you believe OHLC data per bar is not adequate! What would you prefer, and why? -- I don't yet understand the issue!
     
  3. Thanks stepandfetchit for response,

    I honestly do not know if it would be accurate or not, this is what I am trying to understand so I can learn. I am reading the help files in the platform and it states back testing only provides 4 data points Open High Close and Low.

    Maybe I give an example and you tell me if I am correct or wrong.

    If current bar gives long signal, and limit buy order of 55.56 is set. Next OHLC bar prices are O = 55.59, H = 55.61, C = 55.57, L = 55.51.

    Did limit buy order fill at 55.51? If not please explain. Maybe I just back test and find out myself.

    Thank you



     
    Last edited: Feb 23, 2017
  4. minmike

    minmike

    Probably not. Bid ask spread. For limit buy orders, i would use less than. For buy stops, less than or equal.
     
    SimpleMeLike likes this.
  5. minmike

    minmike

    Be sure to set your prices to trade at before the info from the current bar.
     
  6. When you state: "current bar gives a long signal" <-- If input to this is at a known time (open or close), then you can more easily determine a logical progression. If the input is at neither of these, then you may need to do a bit more thinking to see if you can work out something useful. Note: you probably already consider some "slippage" factor, that may be able to accommodate some of the unknowns (slight time lag from signal to trade + slippage). A simplification may be viable, whereas your signal occurs on the prior Bar! -- Implies a 1-bar lag in the action, which may be viable, and may make it simpler. -- Some people merely make decision on the BAR Close, allowing action on following Open. -- This way you can insure your sequencing of operation are correct.
    BTW: I'm assuming your back-testing is on equities, and not Options. IF Options, we need to take a totally different approach!
     
    SimpleMeLike likes this.
  7. Thank you mibmike,

    I don't understand. Please give example.
     
  8. Thanks for response,

    Yes, I'm referring to back testing futures on NinjaTrader.

    I will have to read your post several times and reply. I am not sure I understand what you mean I'm still learning phase of programming and strategies development.

    Can you respond a bit more simple language please?

    The strategy gives long signal on the current bar in the example at bar close. The question will limit order execute at the entry in that example please? If not why not?
     
  9. minmike

    minmike

    so you could say i will set a buy limit 1 tick above the previous low.

    But you can't say i will buy 1 tick above the low this bar, because you don’t know the low until the bar is finished.
     
  10. Thanks all for the reply, I called NinjaTrader and they helped me understand the confusion I was having. OHCL data is good enough for what I need to do.

    Thanks for help
     
    #10     Feb 24, 2017