Code:
varlot=NormalizeDouble((AccountFreeMargin()*(varRiskPerc/100))*AccountLeverage()/MarketInfo(Symbol(),MODE_LOTSIZE),2);
where varRiskPerc is the % you want to put on your trade. ie 2%, then varRiskPerc would be 2. varRiskPerc MUST be a double or the formula will always return 0.
Quote:
Originally Posted by DooMGuarD
hi all...
how to calculate the maximum volume for open a order whit my money...
sample
i have USD$1000 and 100:1 and nolimit for volume in open order...
i need to know
1) maximum lots for open order in EURUSD with this money
2) maximum lots for open order in USDCHF with this money
2) maximum lots for open order in GBPCAD with this money
if you have a code, itīs better...
thanks for your help
|