I am using the following lotsize calculation:
double moneyRisk = AccountBalance()*percentRisk*0.01;
double lotSize = moneyRisk / (entry-sl)*dir / (MarketInfo(NULL, MODE_TICKVALUE)/MarketInfo(NULL, MODE_TICKSIZE));
lotSize = MathFloor(lotSize/MarketInfo(NULL, MODE_LOTSTEP))*MarketInfo(NULL, MODE_LOTSTEP);
For me it works 100% ok. I have a EUR account. But when a friend uses that on his GBP account, the lotsize is always too low. It works also 100% for him when trading currencies but when he trades the S&P, gold, silver or other CFDs, it seems to me that his money on risk is calculated in USD. Because when he uses 1% on a 10k account (=100 GBP), the real amount of risk is only 68.90 GBP (I see that by moving the mouse over the stoploss line, then the real amount is shown). Interestingly 100 USD is around 69 GBP at the moment.
But why does it work without any problems (even with all CFDs) on my Euro based account?
I guess it depends on the broker but is there a way to fix it in my code?
Hm... then I would have no chance to fix that...
To add comments, please log in or register