Forum

Average Spread

Hello, I am trying to obtain the average spread, for which I am doing the following: void OnTick () { AverageSpread(); } double AverageSpread(){ NumSpreads++; Spread=Spread+MarketInfo( _Symbol , MODE_SPREAD ); return ( NormalizeDouble ((Spread/NumSpreads), 2 )); } I wanted to know if

How to wait for the for loop to finish to execute an action?

Hello, I am making an EA that draws some levels, I need the levels to be drawn at the end of the FOR cycle, but the execution is not sequential, even if I place the instruction after the FOR cycle, it is executed before. Is there any way to do it? Thank you