Bid, Ask and spread is not changing on every tick on chart by my EA

Asalam o Alykum,

In my EA I am using below code line to display bid, ask, spread on chart...

Comment(StringFormat("Buy at    = %g\nSell at   = %g\nSpread is = %g",nBid,nAsk,nSpr));

The problem is that it updates bid and ask prices only when new candle starts.

Please guide me, how can I correct it?

That's not all code.
qgmql: The problem is that it updates bid and ask prices only when new candle starts.

Update those variables and call that line every tick.

whroeder1:

Update those variables and call that line every tick.

Thank you for the link. Its working now :)