Issue with first bars of new trading week

 

My python algo script sometimes returns incorrect bars at the start of a new trading week, wiht the most recent bar.

I call copy_rates_from_pos twice, with a 30s delay.

I have max bars in chart set to the lowest, 50000.

AI tells me that it could be an issue with the caching, and I should

a) set max bars in chart to unlimited

b) use copy_rates_range instead, as it is more stable


Does anyone have any experience with this issue?

Thanks!

 
jakfdjkafldadfs:

My python algo script sometimes returns incorrect bars at the start of a new trading week, wiht the most recent bar.

I call copy_rates_from_pos twice, with a 30s delay.

I have max bars in chart set to the lowest, 50000.

AI tells me that it could be an issue with the caching, and I should

a) set max bars in chart to unlimited

b) use copy_rates_range instead, as it is more stable


Does anyone have any experience with this issue?

Thanks!

Post the code if you need coding help.
 
jakfdjkafldadfs:

My python algo script sometimes returns incorrect bars at the start of a new trading week, wiht the most recent bar.

I call copy_rates_from_pos twice, with a 30s delay.


It's advisable to check if the terminal is connected (could be not yet connected at start-up or after a connection drop off), and timeseries are synchronized - before calling copy rates.