Yes, there is a problem. Additionally, queries (SYMBOL_VOLUME and SYMBOL_VOLUME_REAL) also do not work.
//+------------------------------------------------------------------+ //| ProjectName | //| Copyright 2018, CompanyName | //| http://www.companyname.net | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnTick() { long volume=SymbolInfoInteger(Symbol(),SYMBOL_VOLUME); double volume_real=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_REAL); MqlTick m_tick; if(!SymbolInfoTick(Symbol(),m_tick)) return; Print(TimeToString(m_tick.time,TIME_DATE|TIME_MINUTES),",", " Bid ",DoubleToString(m_tick.bid,Digits()), " Ask ",DoubleToString(m_tick.ask,Digits()), " Volume ",IntegerToString(m_tick.volume), " Volume real ",DoubleToString(m_tick.volume_real,0), " SYMBOL_VOLUME ",IntegerToString(volume), " SYMBOL_VOLUME_REAL ",DoubleToString(volume_real,0)); } //+------------------------------------------------------------------+
Result:
1 (AUDUSD,H1) 2020.04.22 09:01, Bid 0.63184 Ask 0.63195 Volume 0 Volume real 0 SYMBOL_VOLUME 0 SYMBOL_VOLUME_REAL 0
Try restarting the computer (not the terminal, namely the computer). Also indicate the equipment on which there is a problem (after starting the terminal, take the first three lines from the Journal tab).
I have this:
Terminal MetaTrader 5 x64 build 2380 started for MetaQuotes Software Corp. Terminal Windows 10 build 19041, Intel Core i3-3120M @ 2.50GHz, 1 / 7 Gb memory, 66 / 415 Gb disk, IE 11, UAC, GMT+2 Terminal C:\Users\barab\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075
Also indicate the equipment on which there is a problem (after starting the terminal, take the first three lines from the Journal tab).
A working option is to use CopyTickVolume and CopyRealVolume.
//+------------------------------------------------------------------+ //| ProjectName | //| Copyright 2018, CompanyName | //| http://www.companyname.net | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnTick() { long volume=SymbolInfoInteger(Symbol(),SYMBOL_VOLUME); double volume_real=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_REAL); long volume_array[],real_volume_array[]; MqlTick m_tick; if(!SymbolInfoTick(Symbol(),m_tick) || CopyTickVolume(Symbol(),Period(),0,1,volume_array)!=1 || CopyRealVolume(Symbol(),Period(),0,1,real_volume_array)!=1) return; Print(TimeToString(m_tick.time,TIME_DATE|TIME_MINUTES),",", " Bid ",DoubleToString(m_tick.bid,Digits()), " Ask ",DoubleToString(m_tick.ask,Digits()), " Volume ",IntegerToString(m_tick.volume), " Volume real ",DoubleToString(m_tick.volume_real,0), " SYMBOL_VOLUME ",IntegerToString(volume), " SYMBOL_VOLUME_REAL ",DoubleToString(volume_real,0), " CopyTickVolume ",IntegerToString(volume_array[0])); } //+------------------------------------------------------------------+
Result:
1 (AUDUSD,H1) 2020.04.22 10:05, Bid 0.63283 Ask 0.63291 Volume 0 Volume real 0 SYMBOL_VOLUME 0 SYMBOL_VOLUME_REAL 0 CopyTickVolume 407
- www.mql5.com
I have used your code to test and I do not get the volume, only correlative numbers that return to 1 when a new candle appears ...
I have used your code to test and I do not get the volume, only correlative numbers that return to 1 when a new candle appears ...
You got the volumes. You even highlighted the volumes in the picture.
Yes, there is a problem. Additionally, queries (SYMBOL_VOLUME and SYMBOL_VOLUME_REAL) also do not work.
Result:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Can anyone tell me why it is?
Here the EA
Thank you!!