Error on Market Info: unknown mode 0 for MarketInfo
Please use this to post code . . . it makes it easier to read.

Do you have any other calls to MarketInfo in your code ?
I suspect there is a typo . . or the OP has declared one of the modes he is using as a variable, eg . .
int MODE_SPREAD; double MarketSpread = MarketInfo(CurrencyPair, MODE_SPREAD)*Point;
I think the error is saying that the "type" being passed to MarketInfo has a value of 0 and that isn't valid.
I suspect there is a typo . . or the OP has declared one of the modes he is using as a variable, eg . .
I think the error is saying that the "type" being passed to MarketInfo has a value of 0 and that isn't valid.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void start(){ int MODE_SPREAD; double MarketSpread = MarketInfo(Symbol(), MODE_SPREAD)*Point; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I agree with you that he may have other calls to market-info which could be causing problems. But the above would not compile. That would suck if constant names could be used as variable names. More than likely it's not my earlier guess either because even if the Instrument is Disabled by broker, it'd probably more than likely still give the market info. But we can only guess based on the codes we see and what he'd explained.
Yep, the reason is because Mode=0. So while he thinks he's passing MODE_SPREAD or What_Ever. He's actually passing one of his Variables. Gotcha.
ubzen, when you say that I am passing one of my Variables, can you explain? I dont get it...
Hi,
Got an error for MarketInfo. The EA error "unknown mode 0 for MarketInfo" for the trade entry for the codes below:
double MarketSpread = MarketInfo(CurrencyPair, MODE_SPREAD)*Point;
double AskPrice = MarketInfo(CurrencyPair, MODE_ASK);
double BidPrice = MarketInfo(CurrencyPair, MODE_BID);
where CurrencyPair is the currency pair that I wanted to get for info. The data that I have entered for the variable are the major currency pairs such as "GBPUSD", "EURUSD", etc. This normally happens during news hour.
Anyone faced the same issue before?
Thanks.