molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Sat May 18, 2024 4:01 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Volume Errors
PostPosted: Wed Dec 22, 2010 1:25 pm 
Offline

Joined: Wed Dec 22, 2010 1:10 pm
Posts: 5
Are there instructions on how to best set the Lot Size and Max Volume and Position Volume?

I set up the basic settings for Lot Size = 1...and I leave the Max Volume at 1.

I don't understand how these are connected or why the Max Volume and Position Volume keeps showing errors:
-------------
M-EURUSD Warning : Can not execute new order for POSITION_TYPE_SELL for Symbol EURUSD. Maximum Volume 1 reached.
2010.10.01 02:58:14 EURUSD volume=1 lotsize=1 sum=2 maxlotsize=1
07:44:51 2010.10.01 02:58:14 M-EURUSD Warning : Can not execute new order for POSITION_TYPE_SELL for Symbol EURUSD. Maximum Volume 1 reached.
2010.10.01 02:58:15 EURUSD volume=1 lotsize=1 sum=2 maxlotsize=1
-------------
M-EURUSD Warning: Could not get position volume. Assigning volume of 0
-------------

So far the MT5 EA Visual Wizard has actually been fun and very interesting and helpful in learning code. Good job!

Thanks,
Robert


Top
 Profile  
 
 Post subject: Re: Volume Errors
PostPosted: Wed Dec 22, 2010 11:53 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Those errors are normal. MT5 allows only one position per pair. So every time you open a new position, it adds to the existing position. So if lot=1 is used per every trade and Vol = 1, it will be one trade executed.
If lot=0.5 and vol = 1, the ea will be able to execute 2 trades (started by a trade condition) until it reaches 1.
If you want to open a single trade of 0.1 you can use lot=0.1 and vol=0.1
max size of position = max vol = lot size * number of trades the ea can execute in the same direction (long or short) given the trade conditions
"Can not execute new order for POSITION_TYPE_SELL for Symbol EURUSD. Maximum Volume 1 reached." means that the trade condition is true so the ea is ready to trade but it cannot since it already reached the max volume.

In MT5, getting the total open volume is more difficult than MT4. Sometimes the server does not respond quick enough. In these cases you may see this error "M-EURUSD Warning: Could not get position volume. Assigning volume of 0". It means the server is busy and cannot send the open volume or it has not finished processing the current transaction. In any case, the ea retry several times until it gets the right amount or it fails and assign a zero value.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by Molanis © 2009