Download MetaTrader 5

Moneymanagement / currency problem with gold, indices, commodities

To add comments, please log in or register
Publish your article and thousands of people all over the world will read it!
mar 2016.02.19 17:49 

Hi forum,

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? 

Zirkon 2016.02.19 18:10  
His broker provides wrong values for tickvalue.
mar 2016.02.19 20:12  

Hm... then I would have no chance to fix that...

whroeder1 2016.02.20 02:23  
mar: Hm... then I would have no chance to fix that...
Chance is irrelevant.
  1. Have them fix their settings.
  2. Change brokers.
To add comments, please log in or register