Bot using Tick Timeframe
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
Replies
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
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