Archive

Archive for August, 2009

Applying EST ScriptBots to SP Daily Follow Through Systems

August 9th, 2009 Comments off

Introduction

This article describes the method and results of applying confidence based Ensemble Signal Trader (EST) BioComp Dakota ScriptBots to two very simple base systems. This research was inspired by the writings of Michael Stokes on his MarketSci blog. Thanks to Michael for providing what I consider to be a valuable education to his readers . The systems use continually linked reverse adjusted closing data for the SP futures contract provided by Pinnacle Data Corp. The start date for the trading simulations is January 1, 2005. In my opinion, this is not enough data for quality research. I’m ‘dipping my toe in the water’ here.

System Sp_CounterTrend goes or stays long as at today’s close if today’s closing price is lower than yesterday’s closing price and goes or stays short as at today’s close if today’s closing price is higher than yesterday’s closing price. System Sp_TrendFollower goes or stays long as at today’s close if today’s closing price is higher than yesterday’s closing price and goes or stays short as at today’s close if today’s closing price is lower than yesterday’s closing price (opposite to Sp_CounterTrend). Both systems use the Delta ScriptBot, one has the Counter Indicator parameter set to 1 (true) and the other to 0 (false).

As individual systems, Sp_CounterTrend and Sp_TrendFollower are not adaptive in any way. The purpose of applying EST ScriptBots to the signals generated by these two systems is to create a master system that adapts to the persistence / anti-persistence of the daily trend. No trading costs have been applied as the purpose of this research is not to assess the viability of a trading system.

Base Systems Configuration

The screen images that follow illustrate the configuration of the two base systems.

Sp_CounterTrend Data Settings

Sp_CounterTrend Data Settings

The Delta Period is set to 1 on the Bots and Swarm tab within the Dakota application. The number of Bots is set to 1 because no parameters are being adapted using the swarm.

Sp_CounterTrend Bots And Swarm Settings

Sp_CounterTrend Bots And Swarm Settings

The system hypothetically trades at the close of the most recent day session so a trading delay of zero is used.

Sp_CounterTrend Equity Management Settings

Sp_CounterTrend Equity Management Settings

The configuration of Sp_TrendFollower is the same as Sp_CounterTrend except the Counter Indicator parameter on the Bots and Swarm tab is set to zero.

Sp_TrendFollower Bots And Swarm Settings

Sp_TrendFollower Bots And Swarm Settings

Base Systems Performance

Screen images of the equity curves and hypothetical trade statistics for the base systems follow. It is clear that system Sp_CounterTrend performed much better than it’s converse system over this time period. Note the steadily declining equity curve from approximately April 2006 to April 2007 for this system. I would like to see the master system produce an upwardly sloping equity curve over this period.

Sp_CounterTrend Price Signal Equity Charts

Sp_CounterTrend Price Signal Equity Charts

Sp_CounterTrend Trade Statistics

Sp_CounterTrend Trade Statistics

Sp_TrendFollower produces a mostly downward sloping equity curve. If the EST ScriptBot does it’s job then the periods of poor performance will not be reflected in the master system.

Sp_TrendFollower Price Signal Equity Charts

Sp_TrendFollower Price Signal Equity Charts

Sp_TrendFollower Trade Statistics

Sp_TrendFollower Trade Statistics

Ensemble Signal Trader Systems Configuration

EST ScriptBots that calculate and apply confidence based weights to the input signals will be used to build master systems. ScriptBot EST-Confidence-Weighted calculates a weighting for each input signal that is based on the performance over the adapted lookback period relative to a confidence threshold that specifies what level of performance is required to have 100% confidence in the signal. The weightings are multiplied by each input signal and averaged to determine the output signal. Performance is measured in terms of either proportion of perfect, net direction correct or weighted net direction correct. If the confidence weighting is less than 5% then it is set to zero.

ScriptBot EST-PolarConfidence-Weighted is similar to EST-Confidence-Weighted, however, negative confidence values are applied. If the absolute value of the confidence weighting is greater than or equal to 5% then the signal is used, otherwise a weighting of zero assigned. Thereby, if a signal has produced significantly poor performance over the lookback period then it still contributes to the master system signal without the inclusion of it’s converse system. Only one of the base system signals is required for the system that uses ScriptBot EST-PolarConfidence-Weighted, however, both base systems signals will be used in this case.

The screen images that follow illustrate the configuration of the two EST systems. Note that the signals generated by the two base systems have been added to the Ticker list and that the Volume and Open Interest for the SP contract were deleted. The Equity Management settings are not shown because they are the base systems settings. The EST-PolarConfidence-Weighted settings are not shown because they are the same as those listed below.

Sp_EST-Confidence-Weighted Data Settings

Sp_EST-Confidence-Weighted Data Settings

If you are trying this yourself then don’t forget to set the Trading Delay parameter to zero (the default value is 1). The parameter ranges for the adapted values have not been optimized. It is possible that longer Lookback periods may work better. A Confidence Threshold of 10% was used simply because it seems reasonable.

Sp_EST-Confidence-Weighted Bots And Swarm Settings

Sp_EST-Confidence-Weighted Bots And Swarm Settings

Ensemble Signal Trader Systems Performance

Screen images of the equity curves and hypothetical trade statistics for the base systems follow. Note that the master system equity curves are generally more consistent then the best base system equity curve. ScriptBot EST-PolarConfidence-Weighted produced the best result. However, only one trading simultion per system was run. Ideally, a minimum of ten runs per system would be run and the average results analyzed. As I mentioned earlier, this is a quick bit of work done to see if further research is warranted.

Sp_EST-Confidence-Weighted Price Signal Equity Charts

Sp_EST-Confidence-Weighted Price Signal Equity Charts

Sp_EST-Confidence-Weighted Trade Statistics

Sp_EST-Confidence-Weighted Trade Statistics

For the readers interest, an image of the trade bots appears below.

Sp_EST-Confidence-Weighted Parameter Scatter Chart

Sp_EST-Confidence-Weighted Parameter Scatter Chart

Sp_EST-PolarConfidence-Weighted Price Signal Equity Charts

Sp_EST-PolarConfidence-Weighted Price Signal Equity Charts

Sp_EST-PolarConfidence-Weighted Trade Statistics

Sp_EST-PolarConfidence-Weighted Trade Statistics

Sp_EST-PolarConfidence-Weighted Parameter Scatter Chart

Sp_EST-PolarConfidence-Weighted Parameter Scatter Chart

Conclusion

The confidence based EST ScriptBots were effective when applied to the two base systems over the period from 01/02/2005 to 08/08/2009. Further research will include running the systems from 1982 and including additional base systems. Also, while writing this article it occured to me that EST ScriptBots with multiple adapted lookback periods might be more effective in the long term. For example, lookback period 1 adapted between 20 and 60 trading days, lookback period 2 between 60 and 250 trading days and lookback period 3 between 250 and 500 trading days. The confidence weighting from the three lookback periods would then be averaged to form the signal.

Regards,

James

Categories: Research and Development Tags:

Modeling with Profit 8 and the SIP Indicators Part 1.

August 4th, 2009 Comments off

Introduction

This article describes how to build a Profit 8 system similar to Sp_p0001 that can be downloaded from the Services page on AdaptiveTradingSystems.com. System Sp_p0001 uses unoptimized SIP indicator values as the only inputs. Future articles will demonstrate how additional inputs can be used with the SIP indicators.

Method

Step 1. Adding the SIP Indicators to the Securities List

This step assumes that you have downloaded the SIP indicators to your computer. For further information on downloading the SIP indicators go to the Trading Signals page at AdaptiveTradingSystems.com.

Start Profit 8 and click on the Add Text File toolbar button to open the file selection dialog. Browse to the location of the SIP indicator text files and open the first file. The File Definition Dialog will then appear.

Step 1. Adding the SIP Indicators

Step 1. Adding the SIP Indicators

Click on the SIP indicator column name (in the example it is SIPAP) and click on the Close radio button in the Settings section. Click on Ok to finish adding the SIP indicator to the Securities list in Profit 8. Repeat this step for each of the SIP indicators.

Step 2. Adding the Data Series for Modeling

On the Data tab in Profit 8, double click on the security name of the data series that you are modeling. This example models the continuously linked reverse adjusted SP futures contract data from Pinnacle Data Corp. Scroll down the list of securities until you see the the SIP indicators. Double click on each SIP indicator until they have all been added to the list of ‘Data to Use’.

Step 2. Adding the Data Series for Modeling

Step 2. Adding the Data Series for Modeling

Step 3. Setting the Data Import Dates

The most recent four years of data will held back  for validating the models. This is called out-of-sample (OOS) data. To ensure that the last four years of data is not used, the end date for importing data is set to 07/31/2005.

Step 4. Importing the Data

Click on the ‘Import Data’ toolbar button to import data from 07/01/1997 to 07/31/2005.

Step 4. Importing the Data

Step 4. Importing the Data

Step 5. Equity Engine Parameters

No transaction costs are applied in this example. Change the Slippage and Commission values  to zero on the Equity Calculations tab.

Step 5. Equity Engine Parameters

Step 5. Equity Engine Parameters

Step 6. Setting the Trading Delay

Change the ‘Project the signal by’ to 1 to apply a trading delay of 1 bar. Signals generated on any given day are executed on the close of the next trading day when using a trading delay of 1 bar.

Step 6. Setting the Trading Delay

Step 6. Setting the Trading Delay

Step 7. Creating the Predicted Series

The inputs and predicted series are defined on the Indicators tab in Profit 8. In this case, there is no need to modify the dates that optimizations are applied to because no optimizations will be run. Go to the Indicators tab and delete series SP.LNG_VOLUME from the list of indicators. Copy series SP.LNG_CLOSE, this series will then appear at the bottom of the list of indicators.

Step 7. Creating the Predicted Series

Step 7. Creating the Predicted Series

Apply the 1 bar change transform to series SP.LNG_CLOSE and then make a copy of it. Apply the Binary+- transform to the first copy. Apply the Abs (Absolute Value) transform and then the Sqr (Square Root) transform to the second copy.

Select both copies of transformed SP.LNG_CLOSE series and multiply one by the other by applying the Prod (Product) transform. Another series will then be automatically created. Multiply this series by 0.1 so that the majority of values fall between -1 and +1.

Delete the 2 series that were multiplied together and then apply a +2 bar Shift to the newly constructed series. This completes the construction of the target / predicted series. To check that the predicted series has been created successfully, graph the series by selecting it and clicking on the Graph as Signal toolbar button.

Step 7. Graph the Predicted Series

Step 7. Graph the Predicted Series

The equity curve should be very smooth and the Percent of Perfect statistic on the  Trading Report should be very close to 100%.

Step 8. Selecting the Predicted Series

Select the Model Building tab and then select the newly constructed series in the Indicators list. Click on the drop down menu above the Indicators list and select ‘Predicted’.

Step 8. Selecting the Predicted Series

Step 8. Selecting the Predicted Series

Step 9. Data Handling Settings

Change the modeling start and end dates to begin on 7/31/1998 and end on 7/31/2005. Change the Modeling parameters to that Random data points are used.

Step 9. Data Handling Settings

Step 9. Data Handling Settings

Step 10. Model Settings

On the Model Settings sub-tab modify the parameters so that 50 models are constructed per run with the top 2 models selected per run completing a total of 10 runs. Set the minimum passes to 200.

Step 10. Model Settings

Step 10. Model Settings

Step 11. Performance Settings

On the Performance Settings sub-tab set the Optimization Metric to RSquared.

Step 11. Performance Settings

Step 11. Performance Settings

Step 12. Start Modeling

Click on the Start Modeling button to begin the modeling process.

Step 12. Start Modeling

Step 12. Start Modeling

Step 13. Constructed Models

When Profit 8 has completed building models there will be 20 models listed on the Models tab.

Step 13. Constructed Models

Step 13. Constructed Models

In the above image, the first model is selected. The equity curve is reasonly smooth for this model. This is an example of a model that we want to keep.

Step 14. Remove Junk Models

Select each model in turn. If the equity curve isn’t smooth or the % of Perfect is relatively low then delete the model. The following 2 images are examples of models that will be deleted.

Step 14. Remove Junk Models

Step 14. Remove Junk Models

In the above image the signal is entirely above zero. This model should definitely be deleted.

Step 14. Junk Model Example 2

Step 14. Junk Model Example 2

After deleting all junk models there are 10 models left. The number of models that are retained will vary.

Step 14. Manually Selected=

Step 15. Change Import End Date

To view the performance of the system over the out-of-sample period the data importation dates need to be modified.

Step 15. Change Import End Date

Step 15. Change Import End Date

After updating the end date, click on the Import Data toolbar button to import the data.

Step 15. Import OOS Data

Step 15. Import OOS Data

Step 16. View OOS Performance

Click on the Results tab to view the out-of-sample performance. Finally, save the system if you haven’t done so already.

Step 16. View OOS Performance

Step 16. View OOS Performance

Regards,

James

Categories: Educational Articles Tags: