Ratio Adjusted versus Pointed Adjusted Contracts in TradeStation – Part 1

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:

Panama vs Ratio Adjusted

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.

As you can see from the P/L from each trade list there is a big difference.  The top list is using RAD and the second is the generally accepted Panama Adjusted Data (PAD.)  Ratio adjusted data takes the percentage difference between the expiring contract and the new contract and propagates the value throughout the entire back history.  This is different than the PAD we have all used, where the actual point difference is propagated.  These two forms of adjustment have their own pros and cons but many industry leaders prefer the RAD.  I will go over a little bit of the theory in my next post, but in the mean time I will direct you to Thomas Stridsman’s excellent work on the subject in his book, “Trading Systems That Work – Building and Evaluating Effective Trading Systems”.

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

RAD V PAD DrawDown

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( "" );
Arrays: tradesPerArr[1000](0),drawDownArr[1000](0);
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;
FileAppend(FName, TradeStr2);
End;
TotTr = TotalTrades;
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;
tradesPerArr[TotTr] = Prof - 1;
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;

FileAppend(FName, TradeStr2);
End;
vars: tradeStr3(""),
ii(0),avgTrade(0),avgTrade$(0),cumProf$(0),trdSum(0),
stdDevTrade(0),stdDevTrade$(0),
profFactor(0),winTrades(0),lossTrades(0),perWins(0),perLosers(0),
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
stdDevTrade = standardDevArray(tradesPerArr,TotTr,1);
stdDevTrade$ = stdDevTrade*c*bigPointValue;
For ii = 1 to TotTr
Begin
trdSum = trdSum + tradesPerArr[ii];
// print(d," ",ii," ",tradesPerArr[ii]);
If tradesPerArr[ii] > 0 then
begin
winTrades = winTrades + 1;
winSum = winSum + tradesPerArr[ii];
end;
If tradesPerArr[ii] <=0 then
begin
lossTrades = lossTrades + 1;
lossSum = lossSum + tradesPerArr[ii];
end;
If tradesPerArr[ii] > largestWin then
begin
largestWin = tradesPerArr[ii];
// print("LargestWin Found ",largestWin);
end;
If tradesPerArr[ii] < largestLoss then largestLoss = tradesPerArr[ii];
If drawDownArr[ii] < maxDD then maxDD = drawDownArr[ii];
end;
// print("TradeSum: ",trdSum);
if TotTr <> 0 then avgTrade = trdSum/TotTr;
avgTrade$ = avgTrade*c*bigPointValue;
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;
If winTrades <> 0 then avgWin = winSum / winTrades;
avgWin$ = avgWin*c*bigPointValue;
if lossTrades <> 0 then avgLoss= lossSum / lossTrades;
avgLoss$ = avgLoss*c*bigPointValue;
maxDD$ = maxDD *c*bigPointValue;
if lossTrades <>0 and avgLoss$ <> 0 then profFactor = (winTrades*avgWin$)/(lossTrades*avgLoss$);
CumProf = cumProf - 1;
CumProf$ = cumProf*c*bigPointValue;

TradeStr3 = "Total Trades,,"+NumToStr(TotTr,0)+",Num. Winners,"+NumToStr(winTrades,0)+","+NumToStr(perWins,3)+", Num. Losses,"+NumToStr(lossTrades,0)+","+NumToStr(perLosers,3)+NewLine+
"Profit Factor,,"+NumToStr(profFactor,3)+",Largest Win ,"+NumToStr(largestWin,3)+","+NumToStr(largestWin$,0)+",Largest Loss,"+NumToStr(largestLoss,3)+","+NumToStr(largestLoss$,0)+NewLine+
"Avg Profit,"+NumToStr(avgTrade,3)+","+NumToSTr(avgTrade$,0)+",Avg Win,"+NumToStr(avgWin,3)+","+NumToStr(avgWin$,0)+",Avg Loss,"+NumToStr(avgLoss,3)+","+NumToStr(avgLoss$,0)+NewLine+
"Std. Dev,"+NumToStr(stdDevTrade,3)+","+NumToStr(stdDevTrade$,0)+",Cum Profit,"+NumToStr(cumProf,3)+","+NumToStr(cumProf$,3)+",Draw Down,"+numToStr(maxDD,3)+","+numToStr(maxDD$,0)+NewLine;
FileAppend(FName, TradeStr3);
{ Print("Total Trades ",totalTrades," Num. Winners ",winTrades," ",perWins," Num. Losses ",lossTrades," ",perLosers);
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$);
Print("St Dev ",stdDevTrade," ",stdDevTrade$," Cum Profit ",cumProf," ",cumProf$," Drawdown ",maxDD," ",maxDD$);}


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.

Stridsman Function Output.

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.

RAD TradeStation Metrics:

Profit $350K – Draw Down $140K

PAD TradeStation Metrics:

Profit $89K – Draw Down $45K

Stridsman Func on RAD:

Profit $70K – Draw Down $48K

At this point you can definitely determine that the typical RAD/TS metrics are not all that usuable.  The PAD/TS results look very similar to RAD/StridsmanFunc results.  Stay tuned for my next post and I will hopefully explain why RAD/StridsmanFunc is probably the most accurate performance metrics of the three.


Discover more from George Pruitt

Subscribe to get the latest posts sent to your email.

Leave a Reply