Multitimeframe - MarketData.GetSeries Same Behaviour in Backtesting and Optimization needed

Created at 16 Dec 2016, 11:46
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
AN

andi21

Joined 14.12.2016

Multitimeframe - MarketData.GetSeries Same Behaviour in Backtesting and Optimization needed
16 Dec 2016, 11:46


Dear Spotware Team,

in my opinion it would be very nice if MarketData.GetSeries behaves same in backtesting and also in optimization. So for the current timeframe of a bot MarketData.GetSeries gets the same result for both backtesting and in optimization (data also from past the selected period which is good). But in multitimeframe scenarios only in backtesting MarketData.GetSeries gets results (count > 0 for the past of the selected period) for other timeframes than the current one. In optimization it does not receive any data for other timeframes for the past of the selected period (count 0).

So the behaviour and results would be like expected the same in optimization and in backtesting with the optimization-parameters.

That would be really really great and i think this is a must-have.

Thanks in advance and hope to see this improvement.

Best Regards,

andi21


@andi21
Replies

Spotware
23 Dec 2016, 14:06

Hello andi21, 

Thank you for your detailed suggestion, you point of view is well understood and appreciated. It is something we have always planned to do and hope to acheive that soon. 

We look forward to other users comments in this thread too. 

Regards, 

cTrader Team


@Spotware

meistereumann
28 Dec 2016, 20:06

Has it always been like that? Because i was using multi-timeframe bots ever since and just noticed it while optimizing my latest cBots..

Well so we actually can not optimize our multi-timeframe algos?! Thats idd a serious problem, is there any ETA on when this will probably be fixed?


@meistereumann

shagar
29 Dec 2016, 07:21

The same behaviour for back testing and optimization of Multitimeframe cBots is essential

I am currently porting my MT5 EA's to cTrader/cAlgo due to a lack of Australian brokers that support MT5 and the fact that i see great potential for cTrader. If I am to be successful in porting my Indicators and EA's, I need to be able to properly backtest and tune them.

Since nearly all of cBots will use multitimeframe indicators, it will be nearly impossible for me to finish the project. The only option I can think of at the moment is to forward test using sereral demo accounts and manually optimising the settings or create my own backtesting tools. This will be very time consuming and I may have reconsider if cTrader is mature enough for me to continue this project.

I sincerely hope that this issue can be resolved soon.

Regards, Shane.


@shagar

MartSmart
13 Jan 2017, 22:17

I noticed the same issue and was struggling days to find out why optimization gives totally different results to backtesting until I've found this thread. It is very unfortunate that the application does not even indicate that some data is missing and presents incorrect results. Could you please work on fixing this bug with a high priority? I believe that many other traders might be using multi-timeframe algos and get mislead by the simulation. It is really a serious issue. What's the current status and ETA? Thank you!
@MartSmart

meistereumann
01 Mar 2017, 12:34

Any news on this issue? Is optimizing multi-timeframe algos now possible??


@meistereumann

bobby86
10 Aug 2017, 00:45

I've seen that if you select multiple timeframes in optimization, the first time frame is used in all the parallel backtesting.

So for instance if you have something like this:

protected virtual void onBar(){

      Print(TimeFrame);

}

 

in Optimization with all the timeframes selected, you will get "Minute" in the Logs for all of them, no matter the actual timeframe.


@bobby86

bobby86
10 Aug 2017, 01:10

RE:

lismanb@gmail.com said:

I've seen that if you select multiple timeframes in optimization, the first time frame is used in all the parallel backtesting.

So for instance if you have something like this:

protected virtual void onBar(){

      Print(TimeFrame);

}

 

in Optimization with all the timeframes selected, you will get "Minute" in the Logs for all of them, no matter the actual timeframe.

 

I managed to get the right TimeFrame using MarketSeries.TimeFrame.


@bobby86

sifneosfx
17 Aug 2019, 18:55

Same problem here, please fix!


@sifneosfx

sifneosfx
18 Aug 2019, 11:38

Best workaround I found sofar is to check if value is NaN. Example:


            if (!double.IsNaN(sma_daily.Result.LastValue))
                { 
                    do not validate sma_daily
                }
           else
               {
                    valildate sma_daily
                }

This way, you will always get same results on optimization and on backtest. You will just 


@sifneosfx