ERR_INVALID_TRADE_VOLUME

 

Hello guys, 

I have this error and i just can't solve it. 

Could any of you give me some tips ? 

            int ticket = OrderSend(Symbol(), OP_BUY, 0.1, Ask, 10, 0, 0, "Auto Buy", 12345, 0, clrGreen);

When i change this to this:

            int ticket = OrderSend(Symbol(), OP_BUY, 1.00, Ask, 10, 0, 0, "Auto Buy", 12345, 0, clrGreen);

It works, but it says account does not have enough money. 

How can i write correctly 0.01 lot to pass EA validation in marketplace to being able to sell my ea ? 

 

Check the specification of the symbol:

SYMBOL_VOLUME_MIN Minimal volume for a deal
SYMBOL_VOLUME_MAX  Maximal volume for a deal
SYMBOL_VOLUME_STEP Minimal volume change step for deal execution

use SymbolInfoDouble().

Documentation on MQL5: Market Info / SymbolInfoDouble
Documentation on MQL5: Market Info / SymbolInfoDouble
  • www.mql5.com
Returns the corresponding property of a specified symbol. There are 2 variants of the function. 1. Immediately returns the property value. 2...
 
Carl Schreiber #:

Check the specification of the symbol:

SYMBOL_VOLUME_MIN Minimal volume for a deal
SYMBOL_VOLUME_MAX  Maximal volume for a deal
SYMBOL_VOLUME_STEP Minimal volume change step for deal execution

use SymbolInfoDouble().

Can i implement this to somehow calculate this and pass validation ? My ea works perfectly without this addiction in live market conditions and profitable for months now, but this marketplace validation is such a headache. 


I saw validation uses 1000 dollar account, how can i correctly tell the ea the lot sizes ? 0.01 and 0.1 does not work, 1.0 does not work either, because it needs higher margin.