Example Marketbook

 

I know there are differences between brookers. But why does the example downloaded below work for some and not others?

int OnInit()

{

MarketBookAdd(_Symbol);

return(INIT_SUCCEEDED);

}


void OnTick()

{

MqlBookInfo priceArray[];

bool getBook=MarketBookGet(NULL,priceArray);

if(getBook)

{

int size=ArraySize(priceArray);

Print("MarketBookInfo for ",Symbol());

for(int i=0;i<size;i++)

{

Print(i+":",priceArray[i].price

+" Volume = "+priceArray[i].volume,

" type = ",priceArray[i].type);

}

}

else

{

Print("Could not get contents of the symbol DOM ",Symbol());

}

}

Reason: