Even if we assume that one or several trading sequences on different markets
give an accurate picture of how the trades will be distributed in the future, in
regard to the relative amount of winners and losers and all the shapes and forms
they can take, there is still no saying that a certain-sized winner will be followed
by a certain-sized loser, or that there won’t be more than a certain number of los-
ers in a row. In real-life trading on unknown data, anything can happen by pure
chance.
To prepare for that, you need to take all the generated trades and scramble
them around, then pick one trade at a time, at random, to create one or several new
trading sequences, based on the original trades from one or several markets or sys-
tems. The reasoning behind this analysis is that if the system is robust and stable,
it will continue to produce trades similar to those already generated, with the only
significant difference being the sequence of these trades and how they are posi-
tioned in relation to each other.
To collect all your trades in one bag, so to speak, you can use the following
piece of TradeStation code, which simply exports the end result of each trade into
a text file, where all trades will be stored in one column.
{Robustness export, with Normalize(True). Set RobustnessSwitch(True).}
Variable: RobustnessSwitch(True);
If RobustnessSwitch = True Then Begin
Variables: RobNameLength(0), RobFileString(""), ResultString(""),
EndTrade(0);
If BarNumber = 1 Then Begin
RobNameLength = StrLen(GetStrategyName) - 6;
RobFileString = "D:\BookFiles\RobustTest-" + RightStr(GetStrategyName,
RobNameLength) + "-" + RightStr(NumToStr(CurrentDate, 0), 4) + ".csv";
End;
EndTrade = TotalTrades;
If EndTrade > EndTrade[1] Then Begin
ResultString = NumToStr(PositionProfit(1), 2) + NewLine;
FileAppend(RobFileString, ResultString);
End;
End;
Once the trades are collected, they can be pasted into an Excel spreadsheet,
which has been prepared for the scrambling and the random picking of all trades,
to form as many new and randomly created trading sequences as you wish. Figures
22.1 to 22.3 show what parts of such a spreadsheet could look like. Let’s look at
Figure 22.1, which shows a small part of a subsheet named “Data.” The trades used
here have nothing to do with the systems tested in this book, and for this analysis
CHAPTER 22 Variables 273