Open eabase opened 4 years ago
@vdemydiuk Can you look into this, please?
This works fine for me with this function: Get_instrument_info
I used
https://github.com/TheSnowGuru/PyTrader-python-mt4-mt5-trading-api-connector-drag-n-drop/blob/master/Pytrader_API_V1_03.py
@TheSnowGuru Hi Shay,
This works fine for me with this ...
Well, are you using this mtapi .NET, or your own TCP/IP connector? (I'm using Python with the .NET DLL and didn't roll my own.)
For quick reference , the lines mentioned above are shown here .
@eabase This is not might be an issue. You can check MQL function in MtApi.mq4 and find that function void ExecuteRequest_SymbolInfoTick(JSONObject *jo, string &response) fills all the fields of MqlTick (Volume and Last also).
Please check answer #10 to similar question on MQL5 forum: https://www.mql5.com/en/forum/338238
Indeed seem to be a problem with MT4/5 not populating their returned arguments.
void OnTick()
{
long symbol_volume = SymbolInfoInteger(Symbol(),SYMBOL_VOLUME);
double symbol_volume_real = SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_REAL);
long tick_volume_array[],real_volume_array[];
MqlTick m_tick;
if(!SymbolInfoTick(Symbol(),m_tick)
|| CopyTickVolume(Symbol(),Period(),0,1,tick_volume_array)!=1
|| CopyRealVolume(Symbol(),Period(),0,1,real_volume_array)!=1)
return;
Print(TimeToString(m_tick.time,TIME_DATE|TIME_MINUTES),",",
" m_tick.bid ",DoubleToString(m_tick.bid,Digits()),
" m_tick.ask ",DoubleToString(m_tick.ask,Digits()),
" m_tick.volume ",IntegerToString(m_tick.volume),
" m_tick.volume_real ",DoubleToString(m_tick.volume_real,0),
" SYMBOL_VOLUME ",IntegerToString(symbol_volume),
" SYMBOL_VOLUME_REAL ",DoubleToString(symbol_volume_real,0),
" tick_volume_array[0] ",IntegerToString(tick_volume_array[0]),
" real_volume_array[0] ",IntegerToString(real_volume_array[0]));
}
For performance consideration, don't really want to triple my API/EA requests just to get that volume for ticks...
I noticed this before, and thought it was an MT4 issue, but in their docs, it show that this info should be available. I don't see either Volume or Last coming from the
SymbolInfoTick()
response.