ChaosHunter with NeuroShell Trader

Top  Previous  Next

If you own the NeuroShell Trader® Professional or NeuroShell DayTrader Professional (release 5.5 or greater), you can use those programs to create data for ChaosHunter, and also to execute and trade the ChaosHunter models in real time.

 

Export Data and Indicators from NeuroShell Trader

Both NeuroShell Trader Professional versions (NSTP) can output data in text  or ASCII file format which ChaosHunter reads. You can output any number of indicators as well as the Open price of each price bar by using the NeuroShell Tools -> Export Chart/data menu. Just select "Chart Data Values" and the "File" export destination. After you have chosen the indicators you want to export, make sure you add the Open, too, because ChaosHunter will calculate profit for models based on entering a trade on the open. Then be sure to select "Export a file for the current chart page only", because ChaosHunter will just operate on one stock (or other issue) at a time.

 

Intraday Files

If you export an intraday data file from NeuroShell Trader and save it as a Space separated ASCII file (.txt extension), the file will not be read correctly in ChaosHunter.  This is because the NeuroShell Trader inserts a space between the date and time of the bar.  The result is that the data doesn't appear in the correct columns.  The solution is to save the file exported from NeuroShell Trader as either a Comma separated ASCII file (.csv extension) or a Tab separated ASCII file (.prn extension).  If you are using daily, weekly, or monthly files, this problem does not occur.

 

Export data from Trader

 

Now save the NSTP chart you have made, because it will be easier to insert your ChaosHunter model into this same chart later.

 

Open Data File in ChaosHunter and Create a Model

Now in ChaosHunter, load up the file that was exported. Note that in the beginning of the file some indicators may contain the value of asterisk (*).  In both NeuroShell and ChaosHunter this means the value is missing, which usually occurs because not enough bars are available yet to compute an indicator with some lookback parameter.  It is recommended that you tell ChaosHunter to skip such data rows by selecting the appropriate radio button on the bottom of the ChaosHunter Inputs tab.

 

You can make your model to either predict the future value of some time series, or to create profit based signals, depending on what you select for an Optimization goal function on the Optimization tab. The goals labeled Trading Strategies are profit based, and to use them you will need to select the Open as the output on the Inputs tab. (ChaosHunter calculates profit based on entering a trade at the Open.)

 

Execute the Model in NeuroShell Trader

Once your model is complete, you are ready to execute it from NSTP. The first step is to save the model in ChaosHunter. Use the File menu and select Save Model, but be sure to remember or write down where you saved it, because it will have to be copied to the Template folder of your NeuroShell Trader folder unless you save it there to begin with.

 

After the model is stored or copied to the NeuroShell Trader Template folder, you are ready to load the model into NSTP. Load up the chart that you have previously saved, because it already includes all the indicators that you used as inputs to your ChaosHunter model. Go to the Insert menu and select New Indicator. The category you want is External Program and Library Calls, which is usually near the bottom of the list. Notice that there are three ChaosHunter Indicators you can insert if you have built a profit based model:

 

ChaosHunter Output - this is the actual value of the formula

ChaosHunter Signal - this is a buy or sell signal produced by comparing the output to the buy/sell thresholds

ChaosHunter Equity - this is shows the sum of the profit made by the model

 

Only the Chaos Output is available unless you have made a profit based model. If not, NeuroShell will inform you that you are selecting a "scientific model" when you try to insert the ChaosHunter Signal or ChaosHunter Equity indicators. Such "scientific models" can still be used to trade as you will see from the discussion of ChaosHunter Output below.

 

We will discuss each of the possible indicators that can be inserted. All of them use the same inputs (parameters in NeuroShell) that the model in ChaosHunter selected.

 

ChaosHunter Output

This is the result of the calculations of the ChaosHunter formula derived on every bar. If you are doing a profit based calculation, this formula is compared to a buy threshold and a sell threshold that the ChaosHunter also evolved. If you want to use the NeuroShell Relational indicators to compare this computation to the thresholds and use those indicators in a NeuroShell Trading Strategy, you may do so. Otherwise, it might be easier to use the Signal - see the discussion below about the ChaosHunter Signal.

 

If you have built a "scientific model", in other words you built a non-profit based model that tries to predict price or some indicator, you can still make a NeuroShell Trading strategy with the ChaosHunter Output. In these cases you will also use the relational indicators to compare to a threshold in the Trading Strategy Wizard. You can even used the NeuroShell Optimizer to find the best thresholds to use.

 

The value of the signal will be rounded to less decimal places in NeuroShell release 5.x than the number shown in the ChaosHunter. That is because ChaosHunter uses numbers with more decimal places than NeuroShell does.

 

Refer to the topic Undefined Output if the output values are missing.

 

ChaosHunter Signal

This signal tells you whether you should enter or exit a long or short position. You can examine this signal in the Trading Strategy Wizard to make a decision about when to take a position, instead of comparing the ChaosHunter Output to thresholds. The Signal implicitly knows about the thresholds.

 

Below are the signal values and meanings. The signal starts out at 0, which is a neutral (not in any position). The signal stays at a given value until a new entry or exit occurs.

 

signal = 1:

   Enter into a long position on the next bar.

 

signal = 0:

   Exit the current position on the next bar and enter neutral (no position).

 

signal = -1:

   Enter into a short position on the next bar.

 

To implement the ChaosHunter signal in a NeuroShell Trader Trading Strategy rule, use the  A = B indicator from the Relational Category as follows:

 

Long Entry:  signal = 1

Long Exit:  signal = 0

Short Entry:  signal = -1

Short Exit:  signal = 0

 

If you have specified a true reversal when you created the model in ChaosHunter, the signal will start out at 0 but when trading starts it will go directly between 1 and -1 without ever becoming 0 again. (Do not use the Long Exit and Short Exit rules listed above.) In this case, the switch of signal implicitly signals an exit from the current position simultaneous with an entry into the opposite position.  Note that if you select true reversal in ChaosHunter, in NeuroShell Trader you need to turn on the option for Long/Short entries exit existing short/long positions on the Sizing tab in the Trading Strategy Parameters to insure the results will be the same.

 

Note also that the ChaosHunter Signal is different than the NeuroShell Trader Position indicator, because the ChaosHunter Signal changes value on the bar before the position is to change. In NeuroShell the position signal does not change until the new position has actually been entered. The ChaosHunter signal is therefore easier to use when building "panel of experts" or "ensemble" system in NeuroShell where an overall strategy makes a final decision based on a number of other systems.

 

ChaosHunter Equity

If you put this indicator into a chart, you will see the equity curve from the beginning of the chart. It will be slightly different than the NeuroShell equity curve because NeuroShell restarts the curve and statistics at the end of the Optimization period and at the end of the Paper Trading period (if any). Also, the NeuroShell equity curve has access to both Open and Close prices and can compute the equity based on the Close of each bar. ChaosHunter has only one price stream in the main program (Open is recommended), so there will be slight differences in the equity curves based upon the two different methodologies.

 

Warning about Different Results in ChaosHunter verses NeuroShell Trader Professional

If you export text files from NeuroShell Trader for processing in ChaosHunter, your input data file may contain missing data, usually marked by an asterisk (*). There is a difference in how ChaosHunter and NeuroShell Trader execute trading models optimized on such data sets. For example, suppose the data file has 5 inputs columns, all of which contain some number of asterisks here and there. Not a lot, but suppose no column has complete data in it. In the ChaosHunter interface on the Inputs tab you select all 5 columns as potential inputs for the formula. You check the option to "Skip rows with missing values". At the start of the optimization the program removes ALL rows which have missing data in all 5 checked columns.

 

After the model is optimized in ChaosHunter, you plug it into the NeuroShell Trader and notice that it produces slightly different results (raw formula output, trading signals, final equity) when compared to what you see in ChaosHunter.

 

The reason is that your final formula may contain fewer inputs than you marked on the Inputs tab. For example, say the final formula evolves with just one input of all 5 potential inputs. The NeuroShell Trader template then asks you for only one input time series (besides the Price time series). When firing such an indicator, NeuroShell removes from consideration rows where that particular input has missing data. It does not remove rows which have missing data in the remaining 4 potential inputs because they are not part of the formula. NeuroShell knows nothing about those potential inputs. As a result, the indicator fires with different input data (there are more rows than there were during optimization), and the formula produces slightly different results which may cause new trading signals, or trading signals to shift or disappear. This may be especially true when the formula evolves with technical indicators included, because they look back in time periods which contain more missing rows.

 

It should be noted that the ChaosHunter itself requires all model inputs to be present in the data file when firing the model. The model remembers all inputs (including all potential inputs) on which it was optimized. If any of the model inputs is missing from the data file, the program will issue a warning that inputs are missing and will not fire the model. This ensures that the results of the optimization session always match the results produced by firing the model.

 

Time Flags in NeuroShell Trader

When firing a ChaosHunter model in NeuroShell Trader Professional or NeuroShell DayTrader Professional, the time flag is displayed as an indicator parameter, even though it is not part of the formula.  The purpose is to link up time flag data stream in NeuroShell Trader with the corresponding value in the ChaosHunter model.

 

Chaos Input

Click here if your ChaosHunter formula uses the ChaosVar for special considerations when applying the model to new data.

 

NeuroShell Trader® is a registered trademark of Ward Systems Group Inc.