[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Kelly Fromula



PureBytes Links

Trading Reference Links

Here's my attempt in implementing the Kelly formula in ELA (it's untested):

{Function: Kelly_Form}

Inputs: NTrades(Numeric);
Var: WinP(0),AvgW(0),AvgL(0);

If TotalTrades > Ntrades then begin
  WinP=NumWinTrades/TotalTrades;
  AvgW=NetProfit/NumWinTrades;
  AvgL=GrossLoss/NumLosTrades;
  Kelly_Form=WinP - (1-Winp)*AvgL/AvgW;
  end;

{ 

In a system, I would use it as something similar to the following:

Acct=Initial_Equity+NetProfit;
Number of contracts= floor(Kell_Form*Acct/Margin);

}