Code below fails with error 4901 (ERR_BOOKS_CANNOT_ADD)
regardless of broker. But I know such a code worked some time ago.
Possible reason(s)?
string symbol = "EURUSD";
int OnInit() {
ResetLastError();
if(SymbolSelect(symbol, true) != false) {
if(!MarketBookAdd(symbol))
printf("market book add failed (%i)", GetLastError());
}
else printf("symbol select failed (%s)", symbol);
return 0;
}
void OnBookEvent(const string& _symbol) {
printf("DOM event for %s", _symbol);
}
void OnDeinit(const int reason) {
MarketBookRelease(symbol);
}