calculating lot size based on percent equity without thinking about SL

 

Hi,

I want to calculate lot size based on percentage of equity without thinking about stoploss. Does this calculation correct? and should I multiply the result with leverage?

double PctAccountLotSize(string SymbolLoop, double pctRisk)
  {
   double accEquity = AccountInfoDouble(ACCOUNT_EQUITY);

   double tickSize  = SymbolInfoDouble(SymbolLoop, SYMBOL_TRADE_TICK_SIZE);
   double tickValue = SymbolInfoDouble(SymbolLoop, SYMBOL_TRADE_TICK_VALUE);

   double moneyRisk = accEquity * pctRisk / 100;
   double pointValue = tickValue / tickSize;
   double lots = moneyRisk / pointValue;
   
   return lots;
  }
 
Luandre Ezra: I want to calculate lot size based on percentage of equity without thinking about stoploss. Does this calculation correct? and should I multiply the result with leverage?

You have to always consider your stop-loss to calculate your risk. No stop-loss means infinite risk.

Use the following functions to evaluate the volume based on both Risk and Margin requirements.

OrderCalcMargin

Calculates the margin required for the specified order type, in the deposit currency

OrderCalcProfit

Calculates the profit based on the parameters passed, in the deposit currency

 
Luandre Ezra:

Hi,

I want to calculate lot size based on percentage of equity without thinking about stoploss. Does this calculation correct? and should I multiply the result with leverage?

such option exists in tradingview as well.(no stop loss needed in calculation)


 
Luandre Ezra: I want to calculate lot size based on percentage of equity without thinking about stoploss.

The question makes no sense.

If I buy a stock at $600/share and will exit at %500/share, the risk is $100 per share, not $600 per. The SL must be known.

For FX (or other leveraged instructments), there is no initial risk (except the spread.) Only at the SL can your risk be known, for a given lot size.

Yashar Seyyedin #: such option exists in tradingview as well.(no stop loss needed in calculation)

No Idea what that calculation means, but it is not what you think it is.