MQL4 Function for Lotsize Calculation with AccountRisk
Account Balance * percent = Risk = (orderOpenPrice - OrderClosePrice)*DIR * DeltaPerLot * OrderLots
- 10 is valid only for EURUSD on a USD account. Do it right
- Risk/stoploss is ignoring the spread.
- NormalizeDouble assumes lotstep = 0.01 do it right never use NormalizeDouble, ever.
- You must also verify that you have enough free margin (to open) and at most adverse excursion (mae) of ALL open orders to prevent margin call (stop out). See my lotsize code
Hello,
i have codeing for myself a simple Lotsize calculation and it work good, but i think when i use other symbols like gold then this will give to much lotsize, because i dont have a pipvalue in my calculation, my calculation will give for every symbol same lotsize, can somebody helpt me to make my lotsize function better, that is calculate for every symbol the right risk percent lotsize?
Here is my current code: