MQL4: Found difference in lot calculation between 'spread betting'-accounts and 'normal' accounts...
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I found out, that the lot-calculation for 'normal'-accounts and 'spread-betting'-accounts seems to be different.
In the documentation I found the following for the lot-calculation on futures: SYMBOL_CALC_MODE_FUTURES
Profit = (close_price-open_price)*TickPrice/TickSize*Lots
I'm checking the necessary calculation-method with:
If I change the formula by lots, I get (not normalized)
lots = (invest * tickSize) / (priceDiff * tickValue)
On a GKFX Spread-betting-account and symbol AUDJPYSP (Future), this formula is working well, but
with a Pepperstone account and the symbol USDX (Future), I get:
with:
invest = 10.0 €
tickSize = 0.1
tickValue = 0.1
priceDiff = 0.493
The result is: lots = 20.283
If I place an order with a difference between entry and stop loss of 0.493 and a lot size of 20, the result is, that the real stop-loss is about 877 € and not 10.0 €.
If I extend the formulas with
lots = lots / exchangeRate / contractSize
the result is ok. But these are complete new formulas...and
profit = profit * exchangeRate * contractSize
So there must be an additional parameter, that makes it possible to extend this formula for different account-types.
How can I find out the type of the account and the correct corresponding and really complete formula that is working well with every broker?
Thank you very much!