Help me to correct counting bars number since price cross over ema
Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!

Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!

You agree to website policy and terms of use
i'm new bee im MQL4 , in amibroker , we can easy get bars since price cross ema with built in funtion barsince (). I have been trying to do count bars in mql4 but the result's not correct. Please , to correct my code , thank you so much ><
void OnTick()
double Spread=Ask-Bid;
Comment(StringFormat("Show prices\nSpread = %G\nBar = %d",Spread,sobar));