Getting spread in MetaTrader 4

 

am using the following to compute the spread in points for the current chart:

string symbol = Symbol(); // Get chart symbol

int spread = MarketInfo(symbol,MODE_SPREAD);

spread is being set to 0. I have verified that symbol is valid (set to "EURUSD").

What is wrong with the above?

 

For current chart, use this karan:


int spread = (Ask - Bid) / Point;

 
scorpion:
For current chart, use this karan:

int spread = (Ask - Bid) / Point;

Thanks Scorpion.

Do you or anyone else on this forum know of a way to pass MQL4 strings by reference to a DLL written in C?

I looked at the ExpertSample.dll but it is not of much help.

 

I'm not sure but someone suggested this:


#import "your.dll"
int yourmethod(string& some_string);
#import