use of MT5 Library functions
I would use copyticks or symbolinfotick.
BTW here is the list of all functions: https://www.mql5.com/en/docs/function_indices.
- www.mql5.com
Carl, thanks for the response. I assume you suggest using the alternatives for the ASK, BID prices
I have subsequently been using
ask = SymbolInfoDouble(_Symbol,SYMBOL_ASK); bid = SymbolInfoDouble(_Symbol,SYMBOL_BID); spread = SymbolInfoInteger(_Symbol,SYMBOL_SPREAD);
This seems to work fine.
I'll take a read of the documentation
I tried the ResultDeal option having seen code in article //https://www.mql5.com/en/articles/138 Any help appreciated
You set the ".Name()" but did not ".RefreshRates()" afterwards, so the current tick data wasn't available to you.
if( mysymbol.Name( _Symbol ) && mysymbol.RefreshRates() ) { double ask = mysymbol.Ask(), bid = mysymbol.Bid(); ulong spread = mysymbol.Spread(); };
I am developing the my use of MT5 and trying to get to grips with the libraries and have two questions:-
1. How do I get the bid and ask price using library SymbolInfo. The following code generates Zero 0.00000 for bid and ask but does appear to give a valid spread
I am also trying to retrieve the 'Ticket # " following a trade and tried numerous variations / alternatives and appear to fail - i.e. Ticket = 0
the Trade actions and resB is true
I tried the ResultDeal option having seen code in article //https://www.mql5.com/en/articles/138
Any help appreciated