how i calculate a percent of account in volume to invest in an open position?
Created at 29 May 2014, 21:18
PA
how i calculate a percent of account in volume to invest in an open position?
29 May 2014, 21:18
how i calculate a percent of account in volume to invest in an open position?

modarkat
30 May 2014, 09:38
Calculating Volume based on fixed risk and stop loss
private long GetVolume(double risk, int stopLossPips) { var moneyToInvestInDepositCurrency = Account.Balance * risk; var moneyToInvestInQuoteCurrency = moneyToInvestInDepositCurrency / (Symbol.PipValue / Symbol.PipSize); var volume = moneyToInvestInQuoteCurrency / (stopLossPips * Symbol.PipSize); var normalizedVolume = Symbol.NormalizeVolume(volume); return normalizedVolume; }example of usage with risk 25% and SL 10 pips
var risk = 0.25; var stopLossPips = 10; var volume = GetVolume(risk, stopLossPips); ExecuteMarketOrder(TradeType.Buy, Symbol, volume, null, stopLossPips, null);@modarkat