On my broker it also returns 0.0, however we could assume that under the test conditions of the verification process, that it may in fact return a valid value, so I did a search and found some advice on another thread:
Forum on trading, automated trading systems and testing trading strategies
Sergey Golubev, 2020.04.10 14:10
The checks a trading robot must pass before publication in the Market
Before making a trade request for placing a pending order by a symbol, you should check the limitation on the total volume of open position and pending orders on one symbol - SYMBOL_VOLUME_LIMIT. If there is no limitation, then the volume of a pending order cannot exceed the maximum allowed volume that can be received using the SymbolInfoDouble() volume.
double max_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_LIMIT); if(max_volume==0) volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MAX);----------------
SYMBOL_VOLUME_LIMIT
Maximum allowed aggregate volume of an open position and pending orders in one direction (buy or sell) for the symbol. For example, with the limitation of 5 lots, you can have an open buy position with the volume of 5 lots and place a pending order Sell Limit with the volume of 5 lots. But in this case you cannot place a Buy Limit pending order (since the total volume in one direction will exceed the limitation) or place Sell Limit with the volume more than 5 lots.
double
Forum on trading, automated trading systems and testing trading strategies
Alexandr Gavrilin , 2018/11/27 08:04
I decided.
//в функции до открытия ордера. double max_volume= SymbolInfoDouble (m_name, SYMBOL_VOLUME_LIMIT ); double current_lots=getAllVolume(); if (max_volume> 0 && max_volume-current_lots-dlot<= 0 ) { //PrintFormat("%.2f - %.2f",max_volume , dlot); return 0 ; } //... //функция подсчета объема double getAllVolume() { int itotal= PositionsTotal (); ulong uticket=- 1 ; double dVolume= 0 ; for ( int i=itotal- 1 ;i>= 0 ;i--) { if (!(uticket= PositionGetTicket (i))) continue ; if ( PositionGetString ( POSITION_SYMBOL )==m_symbol.Name()) dVolume+= PositionGetDouble ( POSITION_VOLUME ); } itotal= OrdersTotal (); for ( int i=itotal- 1 ;i>= 0 ;i--) { if (!(uticket= OrderGetTicket (i))) continue ; if ( OrderGetString ( ORDER_SYMBOL )==m_symbol.Name()) dVolume+= OrderGetDouble ( ORDER_VOLUME_CURRENT ); } return dVolume; }After that, the product successfully passed the test.
Forum on trading, automated trading systems and testing trading strategies
Vladimir Karputov , 2018/11/27 11:36
Yes, by the way, consider when calculating that SYMBOL_VOLUME_LIMIT can be equal to "0.0".
In order not to fall for verification:
if (check_volume > SymbolInfoDouble (Symbol(), SYMBOL_VOLUME_LIMIT )) return ;

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
I want to upload my EA to the market
i get a error at the Automatic validation ( When i run it on back test or real accound i dont get any error )
the code is
i read that i need to use the
SYMBOL_VOLUME_limit
but it return me 0.0 and i realy didnt understand how i need to use it
any help please ?