# backtesting with open, close, high and low

I am quite notice at the business of backtesting for an automated strategy. I was wondering, can I/should I use High and Low for this purpose? On one hand, the algorithm will see these prices, but on the other, the order in which they are seen is not defined, so there is a potential ambiguity there. Also, buying at "High" is not realistic since the algorithm will never know that's it is the highest price for the day.

What do you think or advise?

-

No you certainly should not use in simulation any data that you don't know in real environment because simply results will be much different.

Simulation should be created in environment as much possible similar to real environment.

You basically should use only Open values for making trades, High/Close/Low you can use for indicator calculation of past candles.

High/Close states are not usable because you don't know in what order they appear, this can be:

 - Open, High, Low, Close
- Open, Low, High, Close
- Open, High - 2, Low, High - 1, High, Close


If you are using OHLC data and you are calculating operation OnCandle appears then you can use OHLC from past candles and only Open from current.

In general you can use OHLC in current candle for making trades but current candle High/Low should be created online using TickData stream.

-
thanks a lot for your answer. Why can't I use Close though? –  elelias Oct 3 '13 at 10:04
@elelias: because when Close price appears then is not valid any more, often close prices (on stock) are just fixed after live trading was end and are just for indicator of open price on next day. You should not use Close price because is not graduate price on what you can place order, for example market can be closed, you should use next candle open instead that are created only when market was opened or when market are open then you have after each close, valid open price immediately. –  BlackMamba Oct 3 '13 at 10:49