Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1630

 
Alexey Viktorov #:

How not?


iVolumes
 
MakarFX #:
iVolumes

OK... you win :-)))

 

Is it possible to pause the indicator until user presses the button ?

while(!IsStopped()) in mt 5 works and no problems, but mt 4 hangs tight...

 
Vladimir Pastushak #:

Is it possible to pause the indicator until user presses the button ?

while(!IsStopped()) in mt 5 works and no problems, but mt 4 hangs tight...

Like this

   for(i=limit;i>=0;i--)
     {
      if(ObjectGetInteger(0,name,OBJPROP_STATE)==true)
        {
         ....
        }
     }
 
Vladimir Pastushak #:

Is it possible to pause the indicator until user presses the button ?

while(!IsStopped()) in mt 5 works and no problems, but mt 4 hangs tight...

indicators work in one thread, you can't hang them.

MakarFX #:

This is approx.

yes, but you don't need a loop and move it to OnChartEvent and check in ontika that the button flag hasn't triggered.

 
Taras Slobodyanik #:

indicators work all in one thread, you can't hang them.

yes, but you don't need a loop and move it to OnChartEvent, and check in ontika that the button flag has not triggered.

in the tester OnChartEvevnt doesn't work, but the suggested solution does :-)

 
Maxim Kuznetsov #:

OnChartEvevnt does not work in the tester, but the proposed solution does :-)

For indicators it works in the tester :)

 
Taras Slobodyanik #:

for indicators works in the strategy tester as well :)

Особенности работы программ в тестере стратегий - Программы MQL4 - Справочник MQL4
Особенности работы программ в тестере стратегий - Программы MQL4 - Справочник MQL4
  • docs.mql4.com
Особенности работы программ в тестере стратегий - Программы MQL4 - Справочник MQL4
 
Taras Slobodyanik #:

Makar - check)

You're right, it works...there's an error in the docks
Reason: