MQL4: Found difference in lot calculation between 'spread betting'-accounts and 'normal' accounts...

 
Hi to all,

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:

ENUM_SYMBOL_CALC_MODE scm = (ENUM_SYMBOL_CALC_MODE)SymbolInfoInteger(symbol, SYMBOL_TRADE_CALC_MODE);
if (scm == SYMBOL_CALC_MODE_FUTURES)
{
 //... Calculation 
}

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

and

profit = profit * exchangeRate * contractSize

the result is ok. But these are complete new formulas...

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!

Reason: