Hi
What’s the differene between running a backtest and an indicator, i.e. should the ohlc be the same?
I get different values between them on a tick chart. The indicator agrees with the chart but the graph function in the backtest has a different value, for ohlc. Can you explain why?
Thanks
Background info:
indicator:__Indicator_ohlc
return open as "open", high as "high", low as "low", close as "close"
test:__strategry_ohlc
// Conditions to enter long positions
c1=0
IF c1 THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
graph open as "open"
graph high as "high"
graph low as "low"
graph close as "close"
Welcome to the forums. Please use the ‘Insert PRT Code’ button when putting code in your posts to make it more readable. I have tidied up your post for you on this occasion. 🙂
Your image is confusing the question as it appears to show identical values! The answer to your question might be because an indicator is showing the values of a still forming bar or candle and the GRAPH function in a strategy will be the values of the last closed bar or candle.
Hi,
Thanks for the reply and tidy up,
You are correct, it is true, the last values are the same, however, can you explain why the graphs are different?
Many Thanks
Do you got the same behavior in other timeframe than the “tick by tick” one?
Yes, on the 1 second for example.
Are you sure? Because I can replicate the same as you for the tick by tick chart but not in the 1 second chart where OHLC is the same. Please note that there are a lot of candlesticks that don’t exist on a 1 second timeframe if no ticks are received from the market.
For the tick by tick chart, I think the differences come from when the system is evaluated or not (code read and executed) .. but I can’t be sure, I’ll try to get a definitive answer for this. Bear in mind, that there are no OHLC values with a 1 tick chart, but only one price.
Hi,
Ok thanks. I posted the 1 seocnd chart, it looks the same, except the last three data points are not displayed on the backtest graph.
Cheers
Nigel
When you say last three you really mean last one. There were no trades for 14:42:51 and 14:42:52 but trades for 14:42:53. The backtest will not show this until that candle is closed and a new one opened. The indicator will show ‘on the fly’ so has a result to show you.
Hi,
That does make sense, so I can accept that. Cheers.
However, do you have any news regarding the original question?
Thanks