Can not backtest cAlgo robots
Can not backtest cAlgo robots
15 Jul 2013, 06:15
I can not get a full time period of back testing when using cAlgo sample robots. (generally only the first trade will be shown)
I have followed vidio tutorials to the letter and entered all relevant info.
I have reloaded cAlgo (several times) then tryed again.
The robots work successfully on real time trades but not on backtest.
Please can you assist.
Replies
cAlgo_Development
15 Jul 2013, 18:50
There can be several reasons:
- Using functions not supported properly in backtesting such as system timers or depth of market data
- Performing some slow operation in OnTick method, in real life it's ok, but backtesting can become very-very slow so you will have to wait hours or days for the results
- If there is some error in backtesting it is shown in backtesting log
If you post your robot here or send it to engage@spotware.com we will help you to resolve this issue. You can also give us some more details, what do you see when trying to backtest? Is backtesting progress bar completed?
@cAlgo_Development
ctgab
28 May 2015, 20:44
RE:
cAlgo_Development said:
There can be several reasons:
- Using functions not supported properly in backtesting such as system timers or depth of market data
- Performing some slow operation in OnTick method, in real life it's ok, but backtesting can become very-very slow so you will have to wait hours or days for the results
- If there is some error in backtesting it is shown in backtesting log
If you post your robot here or send it to engage@spotware.com we will help you to resolve this issue. You can also give us some more details, what do you see when trying to backtest? Is backtesting progress bar completed?
What causes my cbot not to trade on backtest while it does trades on realtime?.
Can you please specify all of the fucntions that might not be used on backtest, and how to overcome that to make it work on backtest?
You mention time function in this post:
but can you please specify which ones??:
/forum/calgo-support/1229
"Using functions not supported properly in backtesting such as system timers or depth of market data"......
There are no errors on the log and the backtest ends in excatly about the same time as other default bots. Just that there are no trades.
This is and extract of some of the time codes I use ( i converted my mt4 EA to cbot with 2calgo.com)
iTime(NULL, 0, 1);
/////////////////////////
int TimeCurrent()
{
return Mq4TimeSeries.ToInteger(Server.Time);
}
///////////////////////////////
class Mq4TimeSeries
{
private readonly TimeSeries _timeSeries;
private static readonly DateTime StartDateTime = new DateTime(1970, 1, 1);
public Mq4TimeSeries(TimeSeries timeSeries)
{
_timeSeries = timeSeries;
}
public static int ToInteger(DateTime dateTime)
{
return (int)(dateTime - StartDateTime).TotalSeconds;
}
public static DateTime ToDateTime(int seconds)
{
return StartDateTime.AddSeconds(seconds);
}
public int this[int index]
{
get
{
if (index < 0 || index >= _timeSeries.Count)
return 0;
DateTime dateTime = _timeSeries[_timeSeries.Count - 1 - index];
return ToInteger(dateTime);
}
}
}
-----------------------------
Please help, thanks
@ctgab
ctgab
28 May 2015, 22:16
RE:
cAlgo_Development said:
There can be several reasons:
- Using functions not supported properly in backtesting such as system timers or depth of market data
- Performing some slow operation in OnTick method, in real life it's ok, but backtesting can become very-very slow so you will have to wait hours or days for the results
- If there is some error in backtesting it is shown in backtesting log
If you post your robot here or send it to engage@spotware.com we will help you to resolve this issue. You can also give us some more details, what do you see when trying to backtest? Is backtesting progress bar completed?
ok, just solved my problem....turns out I needed to select "tick data" instead of "time frame" on the Backtest configuration input....since my cbot does very precise tick decision trades and it was not entering since it was only having m1 ticks
@ctgab
jwpo
15 Jul 2013, 09:24
RE:
PS. I have just done a complete new install of cTrader/cAlgo and still can not run a full time period backtest with cAlgo robots.
@jwpo