Chart.ScrollXTo when chart is not "focused"

Created at 20 Jul 2019, 19:38
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!
12

1222Ht

Joined 11.11.2017

Chart.ScrollXTo when chart is not "focused"
20 Jul 2019, 19:38


Hi, Thank you very much for reading my question 

I have this problem that Im using, Tick500 Chart, on multiple symbols; and when cTraders launched in the first place on my pc, the number of bars in each chart is 1000. I want to calculate the average barsize of the symbol, and instead of 1000 number of bars , i want 2000 number of bars in the chart. 

i dont know if theres any method to do that , then i come up with something like : 

           Bar_Count = MarketSeries.High.Count;

   if (Bar_Count <= 1500)
                    Chart.ScrollXTo(MarketSeries.OpenTime[0].AddMinutes(-10));

 

thiss barely working fine when i run it under automate and has one instance, number of bars become 2000 , however , when its actual trade with multiple symbols (>10) each running that same indicators . the problem is : on the chart that is displaying right now has that scroll taken place . when i look at other chart , the Chart.ScrollXTo didnt quite appear tove happened... Im just wondering does this method require the chart being "focused" or is there a way to do it that i didnt know and dont have to do it like this at all. and by the way ,  Chart.SetYRange seems to have the same problem on my pc , it only affects the chart that im "looking at "

 

Thank you very much for reading my question

 

 


@1222Ht