If you play around with TradeStation’s custom futures capabilities you will discover you can create different adjusted continuous contracts.  Take a look at this picture:

Both charts look the same and the trades enter and exit at the same locations in relation to the respective price charts.   However, take a look at the Price Scale on the right and the following pictures.

Here is another look at draw down metrics between the two formats.

Who would want to trade a system on 1 contract of crude and have a \$174K draw down?  Well you can’t look at it like that.  Back in 2008 crude was trading at \$100 X 1000 = \$100,000 a contract.  Today May 11th 2020 it is around \$25,000.  So a drawdown of \$44K back then would be more like \$176K in today’s terms.  In my next post I will go over the theory of  RAD, but for right now you just need to basically ignore TradeStation’s built in performance metrics and use this function that I developed in most part by looking at Thomas’ book.

``````//Name this function StridsmanFunc1

Vars: FName(""), offset(1),TotTr(0), Prof(0), CumProf(1), ETop(1), TopBar(0), Toplnt(0),BotBar(0), Botlnt(0), EBot(1), EDraw(1), TradeStr2( "" );
Vars: myEntryPrice(0),myEntryDate(0),myMarketPosition(0),myExitDate(0),myExitPrice(0);
If CurrentBar = 1 Then
Begin
FName = "C:\Temp\" + LeftStr(GetSymbolName, 3) + ".csv";
FileDelete(FName);
TradeStr2 = "E Date" + "," + "Position" + "," + "E Price" + "," + "X Date" +"," + "X Price" + "," + "Profit" + "," + "Cum. prof." + "," + "E-Top" + "," +"E-Bottom" + "," + "Flat time" + "," + "Run up" + "," + "Drawdown" +NewLine;
End;
If TotTr > TotTr[1] or (lastBarOnChart and marketPosition <> 0) Then
Begin

if TotTr > TotTr[1] then
begin
if (EntryPrice(1) <> 0) then Prof = 1 + PositionProfit(1)/(EntryPrice(1) * BigPointValue);
End
else
begin
Value99 = iff(marketPosition = 1,c - entryPrice, entryPrice - c);
Prof = 1 + (Value99*bigPointValue) /(Entryprice *BigPointValue);
//		print(d," StridsmanFunc1 ",Value99," ",Prof," ",(Value99*bigPointValue) /(Entryprice *BigPointValue):5:4);
TotTr = totTr + 1;
end;
CumProf = CumProf * Prof;
ETop = MaxList(ETop, CumProf);
If ETop > ETop[1] Then
Begin
TopBar = CurrentBar;
EBot = ETop;
End;

EBot = MinList(EBot, CumProf);

If EBot<EBot[1] Then BotBar = CurrentBar;

Toplnt = CurrentBar - TopBar;

Botlnt = CurrentBar - BotBar;

if ETop <> 0 then EDraw = CumProf / ETop;

drawDownArr[TotTr] = (EDraw - 1);

myEntryDate = EntryDate(1);
myMarketPosition = MarketPosition(1);
myEntryPrice = EntryPrice(1);
myExitDate = ExitDate(1);
myExitPrice = ExitPrice(1);
If lastBarOnChart and marketPosition <> 0 then
Begin
myEntryDate = EntryDate(0);
myMarketPosition = MarketPosition(0);
myEntryPrice = EntryPrice(0);
myExitDate = d;
myExitPrice =c;
end;
TradeStr2 = NumToStr(myEntryDate, 0) + "," +NumToStr(myMarketPosition, 0) + "," + NumToStr(myEntryPrice, 2) + ","
+ NumToStr(myExitDate, 0) + "," + NumToStr(myExitPrice, 2) + ","+ NumToStr((Prof - 1) * 100, 2) + "," + NumToStr((CumProf - 1) *100, 2) + ","
+ NumToStr((ETop - 1) * 100, 2) + "," + NumToStr((EBot - 1) * 100, 2) + "," + NumToStr(Toplnt, 0) + "," + NumToStr(Botlnt, 0) + "," + NumToStr((EDraw - 1) * 100, 2) +
NewLine;

End;
largestWin(0),largestWin\$(0),largestLoss(0),largestLoss\$(0),avgProf(0),avgProf\$(0),
winSum(0),lossSum(0),avgWin(0),avgWin\$(0),avgLoss(0),avgLoss\$(0),maxDD(0),maxDD\$(0),cumProfit(0),cumProfit\$(0);

If lastBarOnChart then
begin
For ii = 1 to TotTr
Begin
begin
end;
begin
end;
begin
//   		print("LargestWin Found ",largestWin);
end;
If drawDownArr[ii] < maxDD then maxDD = drawDownArr[ii];
end;
if TotTr <> 0 then avgTrade = trdSum/TotTr;
largestWin = largestWin;
largestLoss = largestLoss;
largestWin\$ = largestWin*c*bigPointValue;
largestLoss\$ = largestLoss*c*bigPointValue;
if TotTr <> 0 then perWins = winTrades/TotTr;
if TotTr <> 0 then perLosers = lossTrades/TotTr;
avgWin\$ = avgWin*c*bigPointValue;
avgLoss\$ = avgLoss*c*bigPointValue;
maxDD\$ = maxDD *c*bigPointValue;
CumProf = cumProf - 1;
CumProf\$ = cumProf*c*bigPointValue;

"Profit Factor,,"+NumToStr(profFactor,3)+",Largest Win ,"+NumToStr(largestWin,3)+","+NumToStr(largestWin\$,0)+",Largest Loss,"+NumToStr(largestLoss,3)+","+NumToStr(largestLoss\$,0)+NewLine+
Print("Profit Factor ",profFactor," Largest Win   ",largestWin:5:2," ",largestWin\$," Largest Loss ",largestLoss:5:2," ",largestLoss\$);
Print("Avg Profit ",avgTrade," ",avgTrade\$," Avg Win ",avgWin," ",avgWin\$," Avg Loss ",avgLoss," ",avgLoss\$);

end;

StridsmanFunc1 = 1;``````
Conversion of Performance Metrics to Percentages Instead of \$Dollars

This function will out put a file that looks like this.  Go ahead and play with the code – all you have to do is call the function from within an existing strategy that you are working with.  In part two I will go over the code and explain what its doing and how arrays and strings were used to archive the trade history and print out this nifty table.

In this output if you treat the return from each trade as a function of the entry price and accumulate the returns you can convert the value to today’s current market price of the underlying.  In this case a 15 -year test going through the end of last year, ended up making almost \$70K.

Profit \$350K – Draw Down \$140K