sd2000sd:
I want to get the value of the best bid. EG:
if the best price of the best bid is 2000 and its volume is 5000, then I want to be able to get that 5000 value in a variable.
How can I do this?
I couldnt find anything in SymbolInfoDouble() function.
Please help.
Thanks
You will have to combine a for loop with the MarketBookGet() function. Something like:
//--- globals long ask_volume = 0; long bid_volume = 0; MqlBookInfo BookInfo[]; //--- inside OnInit() MarketBookAdd(_Symbol); //--- inside OnTick() or OnTimer() MarketBookGet(_Symbol,BookInfo); for(int i=0;i<ArraySize(BookInfo)-1;i++) { if(BookInfo[i].type != BookInfo[i+1].type) { ask_volume = BookInfo[i].volume; bid_volume = BookInfo[i+1].volume; } }

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 want to get the value of the best bid. EG:
if the best price of the best bid is 2000 and its volume is 5000, then I want to be able to get that 5000 value in a variable.
How can I do this?
I couldnt find anything in SymbolInfoDouble() function.
Please help.
Thanks