Hi bhongya,
1. bhongya, would you please use SRC button to post your code
2. Alpari UK has different server for MT4 and MT5, they may come from different banks which may also give different pricing (Ask, Bid, Spread, etc) for traded symbol.
3. WTF = Welcome To Forex, bhongya :D
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a mql4 and a mql5 indicator which does nothing but displays spread , swapshort and swaplong value on screen. I noticed that
mql5 displays different values than mql4. I am confused. Which one is right? I am using alpari uk demo account for both mt4 and mt5.
Here's my mt5 indicator:
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
double Ask,Bid;
int Spread;
double swapshort, swaplong;
Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);
Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);
Spread=SymbolInfoInteger(Symbol(),SYMBOL_SPREAD);
swapshort=SymbolInfoDouble(Symbol(),SYMBOL_SWAP_SHORT);
swaplong=SymbolInfoDouble(Symbol(),SYMBOL_SWAP_LONG);
Comment(StringFormat("Show prices\nAsk = %G\nBid = %G\nSpread = %d\nSwap Long = %G\nSwap short = %G",Ask,Bid,Spread,swaplong,swapshort));
return(rates_total);
}
and here is the mt4 script
int start()
{
double Ask1,Bid1;
int spread;
double swapshort, swaplong;
Ask1=MarketInfo(Symbol(), MODE_ASK);
Bid1=MarketInfo(Symbol(), MODE_BID);
swapshort=MarketInfo(Symbol(), MODE_SWAPSHORT);
swaplong=MarketInfo(Symbol(), MODE_SWAPLONG);
spread = MarketInfo(Symbol(), MODE_SPREAD);
Comment ("Show prices\nAsk = ",Ask1, "\nBid = ",Bid1, "\nSpread = ",spread,"\nSwap Long = ", swaplong, "\nSwap short = ",swapshort);
return(0);
}