Trading Systems and Money Management : A Guide to Trading and Profiting in Any Market

(やまだぃちぅ) #1
SumTrLen = SumTrLen + TradeLength[ExportArrayPos];
End;
{6} If PeriodLength <> 0 Then
PercentInTrade = SumTrLen * 100 / PeriodLength
Else
PercentInTrade = 0;
If NoTrades <> 0 Then Begin
AverageProfit = SumProfit / NoTrades;
AverageTrLen = SumTrLen / NoTrades;
PercentWinners = WinningTrades * 100 / NoTrades;
End
Else Begin
AverageProfit = 0;
AverageTrLen = 0;
PercentWinners = 0;
End;
{7} For ExportArrayPos = 0 To (NoTrades - 1) Begin
SumSquareProfit = SumSquareProfit +
Square(TradeProfit[ExportArrayPos]);
End;
{8} If NoTrades <> 0 Then
StDevProfit = SquareRoot((NoTrades * SumSquareProfit -
Square(NetProfit)) / (NoTrades * (NoTrades - 1)))
Else
StDevProfit = 0;
If StDevProfit <> 0 Then
RiskRatio = AverageProfit / StDevProfit
Else
RiskRatio = 0;
{9} If GrossLoss <> 0 Then Begin
ProfitFactor = GrossProfit / -GrossLoss;
LosingTrades = NoTrades - WinningTrades;
If LosingTrades <> 0 and NoTrades <> 0 Then
RiskFactor = NetProfit / ((-GrossLoss / LosingTrades) * NoTrades)
Else
RiskFactor = 0;

88 PART 2 Trading System Development

Free download pdf