Bot using Tick Timeframe

Created at 05 Aug 2020, 17:05
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!
RI

rick779

Joined 24.06.2020

Bot using Tick Timeframe
05 Aug 2020, 17:05


When I using tick timeframe (especially in the backtest), Bars object and Indicators results contains tens of thousands of elements.

 

if you need to do any operation on these (such as .Take(n), .ToList (), .Last(), foreach, etc ...) from the OnTick event it is impossible because the backtest slows down and becomes unusable.

 

Is there any way to limit the maximum size of these lists so that they only contain the last n elements? 

 

many thanks


@rick779
Replies

PanagiotisCharalampous
06 Aug 2020, 08:15

Hi riccardo.buttari,

The API does not offer such a functionality. You might need to develop something yourself.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

nguyenluat.6996
15 Sep 2020, 20:03

There are 3 ways for you:

- Try to keep your time complexity does not exceed O(n^3) and reduce n for your problem, 

- Or try another approaching. 

- Or use a very expensive CPU :D


@nguyenluat.6996