Invalid Volume - Error during EA Validation - page 2

Zsolt Szabo  
I know, because I wrote it also. Just want to understand what is the variable that causes, sometimes the expert can buy the biggest lot, and sometime not. 
Fernando Carreiro  
Zsolt Szabo #: I know, because I wrote it also. Just want to understand what is the variable that causes, sometimes the expert can buy the biggest lot, and sometime not. 

Already answered—margin requirements.

Forum on trading, automated trading systems and testing trading strategies

lot size = money size

Fernando Carreiro, 2022.11.29 01:30

For this example I will use EUR/USD, where 1 pip-lot is worth 10 USD and a pip is defined as 0.0001 (not 0.00001 which is a point).

However when placing the order, one also has to account for the margin requirements and in this case 1 lot is 100000 EUR (1:1 leverage).

For example, for a leverage of 1:100, one would require 1000 USD for a full lot, or 500 USD for 0.5 lots or 50 USD for 0.05 lots.

In this case, your balance of 400 USD would allow placing the 0.05 order but would give a "not enough money" error for the 0.5 lots, even if your stop-loss risk is only 20 pips (100 USD for 20 pips at 0.5 lots).