the different ask/bid levels

 

hello everyone, I've noticed that there might exist two different ask/bid pairs, the one in shown in the trading panel, which is the real ask/bid prices for traders, and the other one is shown on chart, which displays on chart when turned on the "show ask price line" and "show bid price line" options.

if trading cost is charged by commissions, these two pairs might be the same.

the real prices for traders can be obtained by SymbolInfoTick function.

my question is, how to obtain the ask/bid price line values on chart in mql5?

thank you very much

 
double Ask=SymbolInfoDouble(_Symbol, SYMBOL_ASK);
double Bid=SymbolInfoDouble(_Symbol, SYMBOL_BID);
 

thank you for your reply, but this gives the prices as in trading panel, not the prices as ask/bid lines

the reason why I wanna do this is, I want to calculate trade cost via some automatic means instead of static configuration.

thank you

Yashar Seyyedin #: