Thanks! It works!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I need some help. This problem is purely cosmetic and me being lazy (sorry).
When I'm looking the chart, I want to zoomed in the H4, D1 and W1 timeframe.
I can do that using
When I'm at H4, I want it to show the line chart using
Lastly, when I'm looking at H1 and below, I want to zoom out to the third scale
I put all the code in the OnInit() section so that every time I change the timeframe, the chart change the way I wanted.
It is all good when going up the timeframe (M1 to MN1) but the problem appears when going down the timeframe.
On higher timeframe, there are only a few candle bars on display because of CHART_SCALE,5. When I change to the lower time frame, the scale changes but the chart keeps the previous bar counts so the chart is shifted the left which I don't want.
Even though the problem corrected itself after receiving a tick (because of chart autoscroll is on), waiting for a tick to come takes too long.
Disabling and reenabling chart shift or autoscroll (in the code) does not help (or I'm not using it the right way?). WindowBarsPerChart() and CHART_VISIBLE_BARS is read only. WindowRedraw() is doing nothing too.
Any idea or solution is greatly appreciated. Thanks.
Here is the code that I am using