Backtesting bar data missing for 1 day in timeframe.minute
Backtesting bar data missing for 1 day in timeframe.minute
12 Oct 2024, 11:01
Hello,
by using a demo account and broker IC Markets and symbol XAUUSD, the backtesting bar-data are missing for the 5th of September 2024 in timeframe.minute, although these data are shown on the chart of the trading section, so the broker seems to provide these data in general. When I run the bot on the demo account with tick data the data of 5th of September 2024 are available, only in backtesting mode with M1-bar data (= used chart timeframe, so the preferred data source) the day is missing.
What could be the reason? Is it an error in cTrader or are broker data differently provided to trading section and backtesting section?
By the way, the IC Markets live account has all data available, by M1- as well Tick-data backtesting, as well on the chart of trading section. But I would like to build a bot on reliable data and test it on the demo account.
Thank you and best regards,
Bernhard
Following data, screenshots and testing bot as overview.
Chart, trading section of the demo account, shows M1-data of 5th of September 2024:
simple Bot code extract for demonstration:
using cAlgo.API;using cAlgo.API.Collections;using cAlgo.API.Indicators;using cAlgo.API.Internals;namespace cAlgo.Robots{ [Robot(AccessRights = AccessRights.None, AddIndicators = true)] public class BackTestCheck : Robot { private int IndexProcessedFirstTick = 0; protected override void OnStart() { } protected override void OnTick() { int Index_00 = Bars.ClosePrices.Count - 1; if (this.IndexProcessedFirstTick == Index_00) return; else this.IndexProcessedFirstTick = Index_00; int Index_01 = Index_00 - 1; // previous closed bar Print(string.Format("Time: {0}, Bars.OpenPrices: {1}, Bars.ClosePrices: {2}", Bars.OpenTimes[Index_01].ToString("dd.MM.yyyy HH:mm:ss.fff"), Bars.OpenPrices[Index_01], Bars.ClosePrices[Index_01])); } protected override void OnStop() { } }}
When bot run on demo account and M1 chart, by default backtesting settigns (M1 Bar data), default settings not changed except visual mode ticked on:
the result is without data of 5th of September 2024:
when I run the bot on the demo account with tick data and visal mode the data are available:
Replies
BernhardCS
13 Oct 2024, 07:56
RE: Backtesting bar data missing for 1 day in timeframe.minute
Hi Panagiotis,
thanks for your reply and I'm quite sure you will be right ;-)
But I still wonder why the chart history is different to backtesting history data.
So for clarifying 3 questions and I hope I don't bother you, if that is explained in doumentation you could provide me the link to it:
- Chart-data/TimeFrame.M1 => what is the source format the broker provides? Tick-data or directly TimeFrame.M1-data?
- Backtesting-data/Source: M1 from Server => what is the source format the broker provides? Tick-data or directly TimeFrame.M1-data?
- Backtesting-data/Source: Ticks from Server => The source could be only the Tick-data, right?
If your answer to point 1. and point 2. is the same, the problem ist probably not at the broker side, but between 1 and 2 is a difference.
So considerd that your answer above “talk to IC Markets” is right, I guess cTrader gets all broker data (for Charts and Live-Bots) only by ticks and makes/generate all longer timeframes as M1, H1 etc. by it's own - only that would explain that “Backtesting-data/Source: Ticks from Server” and “Chart-data/TimeFrame.M1” gets the same result. Based on that and if that would be true, “Backtesting-data/Source: M1 from Server” have to be a different source by the broker, am I correct with that?
Thank you and best regards,
Bernhard
@BernhardCS
PanagiotisCharalampous
14 Oct 2024, 05:12
RE: RE: Backtesting bar data missing for 1 day in timeframe.minute
BernhardCS said:
Hi Panagiotis,
thanks for your reply and I'm quite sure you will be right ;-)
But I still wonder why the chart history is different to backtesting history data.
So for clarifying 3 questions and I hope I don't bother you, if that is explained in doumentation you could provide me the link to it:
- Chart-data/TimeFrame.M1 => what is the source format the broker provides? Tick-data or directly TimeFrame.M1-data?
- Backtesting-data/Source: M1 from Server => what is the source format the broker provides? Tick-data or directly TimeFrame.M1-data?
- Backtesting-data/Source: Ticks from Server => The source could be only the Tick-data, right?
If your answer to point 1. and point 2. is the same, the problem ist probably not at the broker side, but between 1 and 2 is a difference.
So considerd that your answer above “talk to IC Markets” is right, I guess cTrader gets all broker data (for Charts and Live-Bots) only by ticks and makes/generate all longer timeframes as M1, H1 etc. by it's own - only that would explain that “Backtesting-data/Source: Ticks from Server” and “Chart-data/TimeFrame.M1” gets the same result. Based on that and if that would be true, “Backtesting-data/Source: M1 from Server” have to be a different source by the broker, am I correct with that?
Thank you and best regards,
Bernhard
Hi Bernhard,
If your chart data is different to your backtesting data, try cleaning your backtesting cache in C:\Users\[USER][\AppData\Roaming\[BROKER]\BacktestingCache. If the issue persists, please talk to your broker. It is a bit pointless to try pinpoint the source of the problem yourself. The price feed is a responsibility of the broker. Even if this is a cTrader issue, we cannot intervene unless the broker asks for it.
Best regards,
Panagiotis
@PanagiotisCharalampous
BernhardCS
14 Oct 2024, 07:10
RE: RE: RE: Backtesting bar data missing for 1 day in timeframe.minute
Hi Panagiotis,
I found the cache in c:\Users\[USER]\AppData\Roaming\Spotware\Cache\icmarketseu\BacktestingCache
After deleting … the entire cache folder c:\Users\[USER]\AppData\Roaming\Spotware\Cache … the missing day is now available also on M1-Backtesting data :-) and within the cache folder there is now (but due to deleting before not sure whether it was not there before) a file named with that date
So it was a cache issue, not a broker data issue, thank you for your help to solve it!
Best regards,
Bernhard
@BernhardCS
PanagiotisCharalampous
13 Oct 2024, 06:07
Hi Bernhard,
Talk to IC Markets. They are responsible for their historical data.
Best regards,
Panagiotis
@PanagiotisCharalampous