Indicators on current bar always updating?

 

Hi

I would like to verify that eg iMA for close on current bar will always be recalculated for each incoming tick since each new tick is the new close value for that bar. Am I correct?

Thanks


PS. Is there an easy way to see the calculated values for each of my variables in an EA? I know there is data watch but it works for live data and I have my own tick data so I have not made any connection to the broker from my MT4

 
Georgios Kourogiorgas:

Hi

I would like to verify that eg iMA for close on current bar will always be recalculated for each incoming tick since each new tick is the new close value for that bar. Am I correct?

Thanks

PS. Is there an easy way to see the calculated values for each of my variables in an EA? I know there is data watch but it works for live data and I have my own tick data so I have not made any connection to the broker from my MT4

Hmm... Print(), Alert(), create your own GUI, or write to your own log files?

Documentation on MQL5: Common Functions / Print
Documentation on MQL5: Common Functions / Print
  • www.mql5.com
Data of double type are shown with the accuracy of up to  16 digits after a decimal point, and can be output either in traditional or in scientific format, depending on what entry will be more compact. Data of float type are output with 5 digits after a decimal point. To output real numbers with another accuracy or in a predefined format, use...
 

[ use timer ]

datetime NextSave, LastActiontime;

string LastDate;

if(LastActiontime!=Time[0] || TimeCurrent() > NextSave) {

    LastActiontime=Time[0];

    NextSave = TimeCurrent() + 5;

    

   // some code to execute

}

 
Georgios Kourogiorgas: I would like to verify that eg iMA for close on current bar will always be recalculated for each incoming tick since each new tick is the new close value for that bar. Am I correct?
iMA uses the close for its calculation. The close for the current bar is always changing.
Reason: