- Don't double post
-
int Counted_bars=IndicatorCounted();
Scripts are not indicators. - Why do you have a loop when nothing inside depends on i? And you don't change i so you have an infinite loop.
Continuous scrolling of charts doesn't require loop?
Yellowbeard: Continuous scrolling of charts doesn't require loop?
| It doesn't require code, at all. Turn on autoscroll ![]() |
Thanks! This I know. I'm looking for continuous scroll, in the opposite direction.
Thanks, again! Now, by incremental step. Not jump to end. Candle by candle. Period by period.
I think you want something like that)
//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { int i=Bars; ChartSetInteger(0,CHART_AUTOSCROLL,false); ChartSetInteger(0,CHART_SHIFT,true); ChartSetInteger(0,CHART_MODE,CHART_CANDLES); while(i>=0) { ChartNavigate(0,CHART_CURRENT_POS,-1); Sleep(50); if(IsStopped()) break; i--; } }
Yellowbeard: Now, by incremental step. Not jump to end. Candle by candle. Period by period.
| Fast Navigation - User Interface - MetaTrader 4 Help |

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
Trying to write a script to scroll a chart continuously. Beginning with a pause of 5 seconds. Not sure if this is the right direction. Could someone tell me if this code is the right way to accomplish this?
Thanks!