Sorting Trade Simulation Results

You have a variety of trades and you want to run simulations for each of those on a variety of datasets and sort the results.

First create a list of the trade functions.  Go to the List Wizard , and .

Then select

You will get a list of all of your trades.  Select whichever ones you want, such as:

.  Then click , and .

Give it a name, such as “tradelist”.

Second, create a list of the datasets you wish to have tested.  Go through the same process as above, selecting the datasets AAPL, IBM and MSFT.  Give this list the name “stocklist”.

Next, go to your command palate and enter the following lines of text.  We will explain them in detail below.  Once created they should be run on autoplay.

Some of the lines are indented for clarity; it is not necessary to indent for functionality. 

Line 1 resets all temporary datasets.

Line 2 starts a loop calling up in turn each trade function.

Line 3 starts a second loop calling up in turn each dataset.

Line 4 runs each trade on each stock.  The output of each of the 6 simulations (2 trade      functions run on each of 3 stocks), will be saved and named ‘tradename_stockname’, such as ‘revtrade310_aapl’. 

Line 5 lists the output.

Line 6 ends the inside loop.

Line 7 ends the outside loop.

Line 8 creates a new list ‘resultlist’ from the temporary playlist.

Line 9 ends autoplay.

Then go back to your List Wizard and choose ‘resultlist’:  Here’s what you will see:

Then click on the  button, and enter   #r summary netpla  as shown:

When you click on , you will be presented with the following:

You can sort on the basis of any of the items in the summary.  Just remember to drop the # (pound sign) and add the suffix “a” for all, “l” for long trades, or “s” for short trades.

One of the major advantages of sorting is that you can get the comparative information without having to open each and every file.  Once you have decided on which trade to view, you can open it directly by going to the , and , .  This dataset will have additional tabs for viewing, such as .

-----------------------

reset

  :for #1 :in tradelist

     :for #2 :in stocklist

        #1_#2 gets #1 #2

        list  ‘#1_#2’

  :endfor

  :endfor

resultlist gets playlist

:stop