Gambling Indicators and Artificial Intelligence.

What  Gambling Indicators are
Could Artificial Intelligence help?
Will Artificial Intelligence finally help ?


Neurofuzzy Logic at work
..
. on two well known indicators:   Wilder's ADX and the DMI difference.
Why   this example?.
How to choose the lookback periods.
TradeStation code results  using the  DMI(5) difference
(no fuzzy logic, used as comparison).
SAFIR-X version 2  on ADX(14) and DMI(5) difference.
Examining the solutions
Testing the basic neurofuzzy system on unseen data.

Improving our basic neurofuzzy model
Reconsidering the indicators.

Training on the SP97 10min .

Testing on  Matif CAC40 1998 10 min unseen data.
Testing on Matif CAC40 1997 10 min unseen data.
Testing
on SP500 1998 10 min unseen data.
Testing
on 100 years of daily unseen data, why not ?

Cotton
Orange Juice
Wheat
British Pound


Want to know more ?
What
the Assistant has really done in the background
Further improvements to this system

Summary
Finally, was it so difficult to do ?
How a Neurofuzzy trading system behaves in TradeStation?
Credits and additional information

back to top

Ideas have floated around that the classical indicators like RSI, %K,%D stochastics, DMI ... COULD be nothing different from poor tools for the average trader, and that, if they work, it's only by chance. (so, they were nicknamed "Gambling Indicators").
This statement is certainly true at a first glance, but it has nothing to do with the indicators themselves, rather than with the way they are commonly used.

Most of classical indicators have been developed with a simple idea in mind: They should show to the trader a better reading of price market action, and therefore allow writing simple trading rules because writing trading rules is easier with an easy to read indicator.
These indicators are mainly devised with a logical sounding concept, frequently derived from mechanics, physics, applied for math concepts to the raw price data series.One of the best example sets can be found in Welles Wilder's original work (New concepts in technical trading systems [1978])where the widely known indicators available in any charting package were first introduced (RSI, ADX, DMI, Parabolic..).
Hundreds of new indicators have been designed since this date, and most of them are showing an obvious redundancy when calculated with the same lookback period.

System development
with Gambling Indicators:
The basis remains the same: one or two simple indicators and a few simple rules are the rule of thumb of most trading systems.
The reason is simple: A programmer cannot easily devise a more complicated system without spending a great deal of time on it, and generally speaking, the results produced when testing on unseen data is often disappointing.
After some months or even years of research, anyone in this respect should be disappointing, or at least have lost most of the enthusiasm of the early days. A fix has been suggested to this situation: Hill climbing optimization:
As we cannot easily  adapt the rules' complexity to the market  complexity, let's adapt the indicators to the rules set ...
This is the first big mistake to the robust system development. At a minimum it can show if there is a stability plateau in the indicator's parameters set for the considered set of rules.
But what if the rules were not the best suited? No valid answer given here because we were not able to find the best rules (otherwise, no need to optimize the indicators!)
These do not solve anything concerning the knowledge supposed to be stored in the system code, then no guarantee could be given  regarding its future behavior.

back to top

With the arrival of modern computers, it has been easier to develop Neural Networks algorithms.
Neural Networks are powerful pattern recognition and prediction tools, and the idea that quickly appeared was
Our brain has neurons / It can learn / some traders succeeded in learning to trade
Neural Nets have artificial neurons / they can learn./ They have been proven to be useful in many domains.
==> A  Neural Network fed with all the necessary indicators will learn how to trade the market,
et voila.
Here is the second  mistake!
Experience has shown that if it had been not impossible, the results would not often have been at the level expected by the average AI computerized trader.
As a proof of this, suffice to see the number of ads concerning Neural Networks applied to trading in the early 1990 and the very few  now available to traders.
In the meantime, Neural Nets technologies have been enhanced, computer speed now available is 20 times or more what it was in the early 90, cheaper,  but the results concerning NN trading are still  somewhat sparse.
back to top
For ending, during these last 3 years, most researchers agreed :"Now , it's time to go back to the roots and simple proven things".

An answer in itself to the partial failure of  general AI techniques in the trading area using indicators No magic in it.
This does not mean that it's impossible to succeed in Neural Nets.


This means that it is not so easy than expected from the sophisticated number crunching software.

Neural Networks are better in pattern recognition from raw market data  that in dealing with indicators, that are themselves an interpretation of the raw data. The problem comes from the fact that the Neural Network is not very well suited to understand indicators like the trader can. Their kind of intelligence (is this word well suited ?) is not the same than the human one. At least it's far more mechanical and less subtle, or exactly, less intuitive.
I know  some people that succeed in Neural Networks in trading, but seldom by feeding them with classical indicators. Mainly with  raw price data or filtered data (using FFT's, Wavelets transforms and various signal processing or denoising techniques).

 

We are not able to deal with complex relationships, and the Neural Networks are, but their "thinking" is not similar to ours:A Neural Network will find complex relationships by determining the correct weights that figure artificial synapses, and the control of their internal logic is beyond the scope of the average Neural Network user.
A Neural Network can find very good trading systems on training data, less on unseen data, and the reason is simple: Their learning is made by trial and error, without any control of the logic that is produced to combine the indicators.
Their goal is often to minimize the prediction error, regardless of the method used to develop the logic.
Better is to make it learn from an evaluation function (like net profit).
You can also use alternate methods for training (Genetic Algorithms, Simulated Annealing...), but the problem remains the same: A Neural Network will have the internal structure that fit its needs: To  learn at any price the training set.

A Neural Network is able to discard some useless inputs (indicator), but you will never know why it has been discarded (in fact because the AI predictor did not use it) .

back to top
However, when feeding the Neural Network with this indicator, you're were considering it useful.
This is somewhat disappointing, and finally, we always displace the problem to another one.

I only spoke about NN because they are widely known in this domain, but I could have done the same with other techniques like  machine learning rules' bases, genetic scorecards, genetically evolved Neural Networks, genetic rule bases.

All of them are able to use indicators for training, but generalization on unseen data is the weak point.
I have spent several years full-time- with them, used most of the available commercial products TradeStation compatible, and if I cannot have a definitive idea on what does not work, I have one on why they do not often work as expected on unseen data.
The reason is clear:

Indicators are devised by human who project their perception of the phenomenon on the way they devise the indicator. So what could better use a human  way of thinking? An Artificial Intelligence structure that mimics close  the human way.

This technique exists and is known as "fuzzy logic".

Technical analysis is
in itself a fuzzy concept.

Because the perfect rules that may drive any market are not known (and never will be as for physical and chemistry) the task of the technical analyst is to find an interpretative way to discover the beginning and the end of a trend as soon as it seems to appear.
The information available is the price related (including volume and Open Interest).
Several techniques are trying to modify the original data series into more readable components.
It’s in this sense that such indicators as RSI, DMI, Stochastics and hundreds of other derived data series have been devised since the advent of calculators and computers.
Combining these indicators or interpreting their results is often a cumbersome and deceptive task as you may find some logic to use them properly.
The combinations are so numerous that it’s impossible to test everyone without being never tired, less attentive during the research period.

Indicators above like RSI were built with two levels (overbought-OB / oversold-OS), splitting the range of the RSI indicator into three domains:

RSI>70                             overbought.
RSI<70 and RSI >30         neutral.
RSI<30                             oversold.

back to top

Any technical analyst that tried a system based on RSI and that tried to optimize the above levels have been told those sometimes 30/70 level works, sometimes 25/65, sometimes other values.

More, for a given value set, it’s easy to see that a microscopic variation of the RSI level above or below the OB/OS level would have produced a better result.
In fact, too much precision when using an indicator compared to a given level could bring very unstable results.
Above  frontiers (30 and 70) are defining crisp values of the RSI domains. 30 is 30, not 30.1.
Fuzzyfication of the inputs allow saying that " around" 30 is the Oversold frontier, and "around" 70 the overbought.

In the overlapping zone (that can be seen as centered on 30 or 70), the RSI will be seen as "partially neutral and partially oversold" when around 30, "Partially neutral and partially overbought  when around 70.
The word partially is expressed by the membership functions used in fuzzy logic, but I want to remain simple.

None will say that if RSI=70.1, the market oversold and neutral if RSI =69.9.

Nonsense certainly?
Yes.
What would you think otherwise? That the first thing to do is to see how the trend is ( flat, moderated up, uptrending, and so on)  before declaring the RSI status.
Do you know what you are now doing?
You are doing fuzzy logic.
Your logic is fuzzy in essence, as technical analysis is, as human thinking is.
You just spoke about trend direction (up or down)  in terms that were fuzzy.
You spoke on that to qualify the RSI status that  you feel also fuzzy.
Your brain has built intuitive assumptions between the RSI and the trend strength  that are both fuzzy.
You are doing fuzzy logic without knowing that you were doing it, and attempted to build fuzzy rules to better understand  the RSI signal.
Fuzzy Logic deals with this apparent uncertainty in a very mathematical way of solving the problem of interpreting the indicators. In this sense, the name is misleading. Fuzzy Logic deals with fuzzy sets, but the math involved in it are anything you want but not fuzzy in essence.
back to top
Now, you should better understand our idea of solving the difficult problem of Technical Analysis trading systems:
We need to build fuzzy rules to interpret the indicators.
The rules will be difficult to design to build and to test as they can be numerous. More we are unable to do this task by hand programming.
Computerized techniques can be devised to build the fuzzy rules.
We do not want to waste our time in things that are beyond our own patience, so the computer must do all the tedious work for us (building and  testing the fuzzy  system)
Neural Networks are powerful tools, but their use is not well suited to interpret the  raw indicators. We will use them to enhance the fuzzy rules with some neural network power, that will add neural knowledge to the fuzzy system:
This association is called
neurofuzzy logic. It has been devised to minimize the drawback of both methods (fuzzy logic and neural networks).
... And it's a very powerful one as we will now demonstrate by the example:
We offer as an example to ONLY use TWO widely known indicators as inputs to the neurofuzzy logic trading system:


Welles Wilder's ADX, widely used to be a measurement of the trending non trending characteristic of the market

Welles Wilder's DMI difference .

(DMIplus-DMIminus)
, that is a trend direction indicator. A positive value means that the market moves up (therefore a buy), a negative one the opposite.


back to top

As we are not so stupid, when choosing the indicators to be use as inputs to the neurofuzzy system, we keep in mind a logical idea that is
The DMI difference gives the buy and sell answer (delayed), but we want a subtler interpretation by using the ADX information. The system should be able to build different rules according to the ADX status.At this moment, we do not know how many rules will be necessary, but again, we don't care: The task is devoted to the AI software. We only help it by feeding it with information that seems sounding relevant to us.
A closer examination of the indicators shows that two pieces of important information are lacking: We must tell the system if the ADX is rising or falling, and if the DMI difference is rising or falling too.

So, we will use FOUR inputs to the system:

ADX(14)
DMI(5) difference
ADX(14) -ADX(14)[1] (first derivative)
DMI(5) difference - DMI(5) difference [1] (first derivative).

Now, we need to know what the lookback period for DMI and ADX calculation is.
Here again, a little logical thinking is necessary:
We will feed the systems with the ideal buy sell signals. There is dozen of possibilities of defining what the interesting swing amplitude is to make learn to the system. It's a matter of choice that depends on the trade frequency expected the average trade.

As this is calculated with a template indicator in TradeStation, we only have to choose  lookback periods whose information is consistent with the major moves that we intend to learn.
For example, a DMI(50) difference will certainly be the best suited value if the average duration of the moves is for example 5 bars. DMI( 5) or a little more is certainly better.
Same apply with the ADX.

As our purpose is only to help the software by using a useful indicator, we do not try to optimize the lookback periods of the considered indicators. We only consider  them  measurement tools  that have  their own pros and cons, but this value will remain then fixed.
back to top
To make things clear, we apply a well-known measurement principle used in physics: The measurement instrument there the indicator) must be adapted to the magnitude of what you want to describe with it (here the trend legs of the ideal buy sell sequences).
To remain  more "down Earth", if you want to measure the surface of a room, you may do it with several tools: A surveyor's chain, a 5 m measuring tape, a micrometer caliper...
My guess is that you will choose a measuring tape, that is the best suited too, unless the room has the size of a stadium or of a match box. The same principle applies to technical  indicators, if you want a correct result.

Here we will remain with the default 14 bars lookback period for the ADX,but  5 bars for the DMI difference, only to take advantage of short terms movements.

All  of the tests below will be performed on the SP500 futures 10 minutes bars.
Point value set to US$500, costs to $50 (the point value has been recently changed  to $250, but it does not invalidate anything to the trading result — only use 2 contracts instead of 1).


Before starting, lets do a comparison under the same conditions
I have written this very simple example that does not make use of the ADX(14), but only the DMI(5) difference:
TradeStation code is as follows:

inputs:dm(5);
value1=dmiplus(dm)-miminus(dm);
if value1>0 then buy at h stop;
if value1<0 then sell at stop;


back to top

But stop and sell stops have been added to filter out. It's like adding a small channel breakout to the DMI.difference setup signal.

Let's admit that with a huge research, we could have  been able to devise an Easy Language code able to do 2 or 3 times better than this one (but with the same indicators and no optimization of the lookback period).

Result are below (TradeStation 4 Performance Summary):

DMI SP_9698.2-10 min 03/02/98 - 09/03/98           
    Performance Summary: All Trades        

Total net profit    $ 24450.00    Open position P/L    $ 250.00
Gross profit     $ 473600.00    Gross loss      $-449150.00

Total # of trades    450    Percent profitable     33%
Number winning trades    147    Number losing trades     303

Largest winning trade    $ 19850.00    Largest losing trade     $ -6700.00
Average winning trade    $ 3221.77    Average losing trade     $ -1482.34
Ratio avg win/avg loss    2.17   Avg trade(win & loss)    $ 54.33

Max consec. winners    4    Max consec. losers     10
Avg # bars in winners    22    Avg # bars in losers     7

Max intraday drawdown     $ -32200.00       
Profit factor     1.05    Max # contracts held    1
Account size required    $ 43200.00    Return on account     57%

back to top
Let's have a quick look at the Equity curve produced

spdmi5.gif (24917 bytes)
Click on the above  image to get a larger picture (1600x1200)
[Printed using Portfolio Maximizer by TradeStation Technologies and  RINA systems ]
DMI(5) difference results. No fuzzy logic. 10 min 1998 SP500 data

Somewhat seriously  jagged, but climbing however
Note the serious  Max drawdown (higher than net profit), the low average trade.

back to top


Operating mode:
We just need to build an ASCII file in TradeStation with the four indicators above,
Open the Assistant SAFIR-X  software,
load the ASCII file data
and click on the EXPLORE button.
Now , it's time to go drinking some coffee, and be back in less than 15 minutes...if you are using a Pentium II 300Mhz.
Here is what appears on your screen when you are back:

spdm498.gif (124747 bytes)
Click on the above  image to get a larger picture (1600x1200)
Result of DMI(5) ADX(14) on SP500 980302-980903 10 min data

back to top
Detail's explanations of the various above windows are summarized below.

ALL available solutions tree.
Here Solution #11was selected (1)
All solution results (tied to the tree).
Recallable.Sortable by columns (2)

Costs, settings...


Detailed Performance summary (5)
for the highlighted solution (here #11).
Triple display (Train / Test /Whole).
Equity curve is  hidden by the Details window below (6)

Details on the neurofuzzy rules for the considered selected solution (#11)Sortable   by columns (3) Graphic display of the fuzzy sets for the considered highlighted rule (#227 among 405).
Active fuzzy sets for this rule are green (4)

Journal file. (8)

Shows here the Target Ideal Performance Summary (displayed here, as well as ALL the operations done  during the EXPLORE automated search)

Detailed Equity Curve and trading signals (7)

recall previous solution
(graphic)

zoom

data window

TRAIN
Red=sell
Blue=buy
overlaid on raw train  data

Equity=Yellow line
TEST
Red=sell
Blue=buy
overlaid on raw
test data

Equity=White line

Indicators display
Additional information on rule conflicts

The Assistant Version2 (Windows explanations)

back to top

The system has been trained on the first half of the data file (the same SP500 data than before) and tested on the second half (that is the test data,  unseen to the rules when learning).

Results are far different than what we get with the simple reference DMI5 system:
$ 125590.00 net profit on test data instead of only  $ 24 445.00 for all the 1998 file
Average trade $ 1773.94 on test data instead of  only $ 54.33

We do not even  want to compare the reference DMI system to the whole data (238350.00) that contains Train data already seen by the system ...
This result was achieved only with TWO classical indicators, but exploited to the maximum possible of precision.

Would you have been able to write a trading system featuring 169 (fuzzy) rules in less than 10 minutes and to test it ?
back to top
Certainly not. 15 days , maybe, but I bet that most of the trading system developer (including me first) would give up far before.

By observing the results of all the solution stored in the window (2), you may see that most of the 10 retained solution were quite good.

We must notice that the uptrend has not been correctly understood by the system, so we will consider this fact when later improving the basic system
In fact, the Assistant evolved far more that 10 solutions during these 10 minutes (closer to several hundred systems tested!).

Do you want to examine all of the 10 solutions ?
This is easy as 1 2 3 , because they are all stored in memory.
Please check out the screenshot below:
All the solutions are available from the Details chart window (7) that currently  displays  solution #8.
The best solution (or the active solution #9) remains displayed in the Performance Summary subwindow (6).
Comparing various solutions has never been easy.

spdm498b.gif (124173 bytes)
Click on the above  image to get a larger picture (1600x1200)
Examining the retained solutions (DMI5 and ADX14).

We have move the detailed view (7) to the left. Now this window the features solution #8,
and we can see the original Equity curve of the best solution (#9),
still displayed below the Performance Summary  for an easy comparison

 
Would you like to see the Performance Summary for solution #8?
Easy to do: Only double click on this solution is the Solution tree window (1).
I am not showing this now, because we have better things to do.
The Performance summary  for any solution is also stored in the Journal File (8)
back to top



Now, it's time to do...

Let's take THE SP500 CONTRACT with the same 10 min. bars and of course the same DMI(5) difference and ADX(14).
Testing on unseen data is even easier:
You only need a new ASCII file (similar to the file containing 1998 data)
that you will load into the assistant (here the SP97 TSD ASCII file).
Click on CHECK
Then it will test not only on the current solution (#9) but all the available 10  stored solutions.
Doing so, you can easily see if another solution had been better.
Here are the results for one of them:


spdm497.gif (114639 bytes)
Click on the above  image to get a larger picture (1600x1200)
Result on SP500
961030-970610 10 min unseen data (DMI5 and ADX14).

back to top

The above result shows that the trivial   DMI(5) / ADX(14) the neurofuzzy system can work on unseen data with quite acceptable results.This is not still the case with such simple systems because some important information is being missing
(see for example the first half of the above equity curve: It' s obvious that the system has not well understood the major uptrend of the first half of SMP7).
The explanation is simple:

Two indicators is maybe somewhat dangerous to claim that they will explain most of the possible moves.
However, you can see that we have pushed the limits to the breaking point: Few indicators and biased uptrend data during training ... for an apparently  acceptable result.
back to top
We want better now.

The system is however too simple to get consistent results.

The twin indicator system was used here for demonstration purposes and to accept that there are better ways to find a solution even with a few indicators like these one.

Now we want a robust system able to work with more confidence.

Miracles do not exist in trading systems, and we may devise a better one by using some others additional  indicators to enhance the overall stability and performance.
Now; it's time to do a more serious work.
See the next step coming...

Frankly, we cannot succeed in any good accuracy by using only two indicators.
The market is more complex than this and cannot be reduced so easily to four numbers (including the first differences).

Let's go back to our original idea,
that were

We need to measure the trend quality that was devoted to the ADX(14).indicator.
We observed that the long term trend was not best understood.
So  will increase the ADX lookback period to 25 instead of 14.

We also need to have an idea of the trend direction (ADX gives no clue to this), and we used the DMI(5) difference, that does a short term tend measurement.
Better is maybe to take advantage of DMIplus and DMIminus as independent indicators.
When the long term trend is up, DMIminus equals 0 , and the reverse is observed during the confirmed downtrend (DMIplus =0).
This is an information in itself that we neglected when using the DMI difference.

Due to the fact that our lookback period was maybe too short ( and more, we have increased the ADX lookback) we will chose the following indicators:

DMIplus(7)
DMIminus(7)

instead of the DMIplus(5)-DMIminus(5) difference.

We do not want to increase too much the DMI lookback, because we need an information on the short term and trading range.
As we have no overbought oversold oscillator, DMIplus(7) and DMIminus(7) will carry the short term and trading range information.
We previous used the first difference for ADX and DMI difference.
One must keep the ADX first difference , because  it gives invaluable information   in case of Trading to Trend or Trend to Trading phase.
To decrease the sensitivity, lets take a 3 bar momentum of the new ADX.
Finally, we discard the DMI first difference (DMIplus and DMIminus may bring a similar information, and we want to stay with the same number of inputs (4 in this case) for a valid comparison.
We only discussed how to improve the indicators according to the weaknesses observed with our basic model.

To summary,
the new indicator set is now:
ADX(25)
DMIplus(7)
DMIminus(7)
ADX(25) -ADX(25)[3]
(first derivative,
less sensitive)

back to top

As a rule of thumb, help the neurofuzzy system with logical indicators, then it will help you to the best that it can. Avoid redundancy otherwise you will confuse it as it would confuse you.
Treat it like if it had been a technical analyst ready to code a system to which you provide a basic idea and the indicators that you feel meaningful to solve.

That's all, and that's enough.
To remain simple and to avoid longer training, we will remove the previous first differences that are important too. But we have here two systems to compare, with the same number of inputs (e.g., 4).
In the second case, we have pushed the thought a little bit more in depth to choose the  neurofuzzy inputs.

As a hint, and to determine if the indicators may be correct, we recommend to plot them on the same chart where the ideal buy sell signal is also displayed.
back to top
By eyeballing, you must verify that most of the considered zig zag moves are reflected by an obvious change of at last one indicator.

See the TradeStation chart below that was used to compute the ASCII file in use with the Safir-X Assistant:It should be obvious to anyone  that the small moves are producing DMI's swings, some saturation of the DMI's., big moves show a rising ADX

A general noise seems to appear on indicators. It's noise, but not only noise:

It's the kind of  information that the neurofuzzy logic system will exploit better than any human being.
As we will use the first half of the file, you may notice that we have chosen a better training period showing uptrend and more downtrend, unlike in our first example.

sp4indic.gif (93678 bytes)
Click on the above  image to get a larger picture (1600x1200)
TradeStation Chart on SP500 10 min data (970313 to 970606)
Indicators : ADX(25), DMIplus(7), DMIminus(7), ADX(25) -ADX(25)[3]
.Zig Zag ideal moves (Cyan)


back to top

The same process than with the previous system:
:After  loading the SP500 ASCII file (10 min data from 961021 to 970606)
and launching the EXPLORE  command and drinking another cup of coffee, the results are here:

spom2.gif (127599 bytes)
Click on the above  image to get a larger picture (1600x1200)
Training and testing on SP500 10 min data (961021 to 970606)
Indicators : ADX(25),DMIplus(7), DMIminus(7),ADX(25) -ADX(25)[3] .

A quick examination of the equity curve shows that the system is correct on test data
($36100, e.g., a 137 % ROMID in a 2 months  period with a $ 270 average trade, not so bad).
The Equity Curve continues to climb (white line) on the test data (second half of the file).
Several solutions were found profitable #10,11,19,24...
(best one is #17,displayed here, but remember that they contain training data).
back to top

Let's seen how it is now behaving on unseen data :
We will do more than testing on SP500 data. We chose to test on a different market!


You only have to load the ASCII file related to this period.
Then click on CHECK.
The entire solution stored are evaluated using these unseen data
(wait 2 minutes, in real world):

cac98.gif (115409 bytes)
Click on the above  image to get a larger picture (1600x1200)
Testing on CAC 10 min unseen data (980101 to 980903)
Indicators : ADX(25),DMIplus(7), DMIminus(7),ADX(25) -ADX(25)[3] .

back to top

The best solution is not #17 (normal, see above), but #3, followed by #14,24,16,....
(see Column1 [Test Crit] in the sub window 2).
Nice Equity Curve, nice ROMID (232% in 9 months), good average trade   (FRF 861.38).
This means that the solution that best generalizes is probably in this list.

Now, you may want to examine the behavior of the other solutions on the unseen data.
Easy. They are stored in memory as we explained when first using the software with two indicators.
You may examine all the equity curves.

 back to top

The Performance summary can be stored in the Journal File for all the solutions.
You can even test now using a different Performance Summary field
(Highlighted in red, window 5).

Solution #19 is displayed for comparison in the details window.
This is not the best one for these data.
The sub window 2 also keeps the results of the training and test performed
on the original file, for the entire available solution so you may compare.
Notice  that the solution tree has green dots because we are now in check mode
Our best candidates are probably sol #3 and sol #24 or 14, with a slight preference to solution 3 that has less rules (384 instead of 720 for #14 and #24).
Lets stick with sol #3.


Same process.
We still have the confirmation that solution #19 was not the best one (see Details)
Solution #3 is also in a good place, but solution #24 and #14  too.
This is the confirmation that several of our solutions  are able to generalize.


cac97.gif (120229 bytes)
Click on the above  image to get a larger picture (1600x1200)
Testing on CAC40 97 10 min unseen data (970101 to 971231)
Indicators : ADX(25),DMIplus(7), DMIminus(7),ADX(25) -ADX(25)[3] .

back to top


Let's stick again with the solution #3
and run again the Check mode on the corresponding ASCII file.
5 minutes later, we get all the results for all solutions:

sp4_98.gif (124913 bytes)
Click on the above  image to get a larger picture (1600x1200)
Testing on SP500 10 min unseen data (980101 to 980903)
Indicators : ADX(25),DMIplus(7), DMIminus(7),ADX(25) -ADX(25)[3] .


back to top

The best solution is now #3.
Column1 [Test Crit] in the sub window 2 shows
that the best solutions are #3,20,2,16,24,17,14
We may notice that #3,14,24, were already found as
the best solutions in the previous test on unseen data,
so, it demonstrates their robustness.

If you forgot it, do not worry, so the results are stored in the Journal File.

We definitively save Sol #3 into a FZB file ,
ready to run in TradeStation from a template system.


This model was trained on  4892 bars of SP500 10 min intraday data,
tested on unseen data on a broader scale and even different market.
A robust model must work on different data, different timeframes.
We propose to run solution #3 on...daily data
(US  commodities daily Continuous contracts)!

We will also compare the results with the DMI(7) crossover, directly in TradeStation.

value1=dmiplus(7)-DMIminus(7);
if value1>0 then buy at h stop;
if value1<0 then sell at l stop;

Various commodities are presented here
back to top

Please notice the Equity Curve slope, and the buy sell arrow's location.
Then you will really understand what Safir-X was able to do...with so few information!

cotton.gif (98124 bytes)
Click on the above  image to get a larger picture (1600x1200)
Printed usingTradeSation4 Charting on COTTON  daily data
TOP Neurofuzzy system / Bottom DMI(7) crossover

back to top

orange.gif (92071 bytes)
Click on the above  image to get a larger picture (1600x1200)
Printed usingTradeSation4 Charting on ORANGE JUICE daily data
TOP Neurofuzzy system / Bottom DMI(7) crossover

back to top

wheat.gif (99751 bytes)
Click on the above  image to get a larger picture (1600x1200)
Printed usingTradeSation4 Charting on WHEAT daily data
TOP Neurofuzzy system / Bottom DMI(7) crossover

back to top

bpound.gif (91583 bytes)
Click on the above  image to get a larger picture (1600x1200)
Printed usingTradeSation4 Charting on BRITISH POUND daily data
TOP Neurofuzzy system / Bottom DMI(7) crossover
back to top

We trained the model on SP500 10 min data (961021 to 970606)
using 4892 bars for training with only 4 indicators:

(ADX(25), DMIplus(7), DMIminus(7), and the ADX(25) variation over 3 bars.

It worked on 100 years of daily data and 3 years of 10 min intraday data,
different markets, different timeframes, and outperformed from far
the classical system using the very same directional indicators
breakout system, with fewer trades and steeper equity curves...


What the Assistant has really done in the background with the four gambling indicators set ?

First, the above results prove that it was not gambling at all,
if we were able to discover the proper rules.

This is what Safir-X Assistant  has done for you,
in less than 30 minutes. All automated...

Unfortunately to our comprehension, they are numerous and not easy to understand
You may wish to know more, and we can even go a step further
( the fuzzy rules are disclosed in a special text file if you run the ANALYZE command in the file menu).
You may want to understand, so we provide the necessary tools.

Here is a  partial example of the detailed  information that you may want to get...
back to top

------------------------SUMMARY--------------------

FUZZY DESCRIPTION : new.906252923
DATA from : C:\SirTest\Spom2.tsd
FUZZY VARIABLES :

Ind.1 : <-82.970 | 71.010>; Nb F.S. : 3
Ind.2 : <0.000 | 61.150>; Nb F.S. : 9
Ind.3 : <-64.920 | 79.510>; Nb F.S. : 5
Ind.4 : <-3.090 | 4.530>; Nb F.S. : 3

RESULT OF DATA ANALYSIS (TRAINING PART)

RULE Fuzzy Sets # P. # Mean ConcV # Wrong
31 -0-2-0-1 1 -1.000 -0.273 0 (0 %, 100.0 %)
34 -0-2-1-1 1 -1.000 -1.045 0 (0 %, 100.0 %)
37 -0-2-2-1 1 -1.000 -1.098 0 (0 %, 100.0 %)
46 -0-3-0-1 1 -1.000 -0.243 0 (0 %, 100.0 %)
49 -0-3-1-1 2 -1.000 -0.669 0 (0 %, 100.0 %)
50 -0-3-1-2 1 1.000 -0.140 1 (100 %, 99.5 %)
52 -0-3-2-1 2 -1.000 -1.168 0 (0 %, 100.0 %)
61 -0-4-0-1 1 1.000 0.305 1 (100 %, 99.6 %)
62 -0-4-0-2 1 1.000 0.263 0 (0 %, 100.0 %)
64 -0-4-1-1 4 -1.000 -1.011 0 (0 %, 100.0 %)
65 -0-4-1-2 2 -1.000 -0.393 0 (0 %, 100.0 %)
67 -0-4-2-1 4 -1.000 -1.108 0 (0 %, 100.0 %)

and so on...for all the 397 rules in this model
back to top

RESULT OF DATA ANALYSIS (TEST PART)

RULE Fuzzy Sets # P. # Mean ConcV # Wrong
19 -0-1-1-1 1 -1.000 -0.746 0 (0 %, 100.0 %)
31 -0-2-0-1 1 -1.000 -0.273 0 (0 %, 100.0 %)
32 -0-2-0-2 1 -1.000 -0.085 0 (0 %, 100.0 %)
34 -0-2-1-1 2 -1.000 -1.045 0 (0 %, 100.0 %)
37 -0-2-2-1 3 -0.333 -1.098 1 (33 %, 99.5 %)
38 -0-2-2-2 1 1.000 -0.165 1 (100 %, 100.2 %)
47 -0-3-0-2 1 -1.000 -0.070 0 (0 %, 100.0 %)
49 -0-3-1-1 1 1.000 -0.669 1 (100 %, 99.0 %)
52 -0-3-2-1 1 -1.000 -1.168 0 (0 %, 100.0 %)
53 -0-3-2-2 1 -1.000 -0.365 0 (0 %, 100.0 %)
68 -0-4-2-2 2 -1.000 -0.411 0 (0 %, 100.0 %)
77 -0-5-0-2 1 -1.000 -0.008 0 (0 %, 100.0 %)
79 -0-5-1-1 8 -0.500 -0.900 2 (25 %, 99.8 %)

and so on...for all the 397 rules in this neurofuzzy  model.


Fuzzy rules are also disclosed, for each rule available and for each pattern that occurred for this rule
Fuzzy sets boundaries are disclosed too.
Internal statistics also available (shows the patterns e.g. bars where the rule was active, patterns in error).

I only copy three examples (among 397 available) for this solution:
back to top

------------------------DETAILS (TRAINING) --------------------

Rule ----- 31 (nb patterns = 1) # wrong answers 0 (0 %)
IF (Ind.1 = F.S.0 AND Ind.2 = F.S.2 AND Ind.3 = F.S.0 AND Ind.4 = F.S.1 ) THEN Sig1 = -0.2728;
<-159.960 | -5.980>; <11.943 | 20.184>; <-137.135 | -19.786>; <-3.090 | 4.530>;

Pat#     Exp. Comp. Act. Err
1430 -53.629 17.747 -51.599 1.765 -1 -0.371 0.27 0 0.63
--------------------- Mean value : -1.000 Min value : -1.000 Max value : -1.000 Conclusion value : -0.273

Rule ----- 171 (nb patterns = 16) # wrong answers 7 (44 %)
IF (Ind.1 = F.S.1 AND Ind.2 = F.S.2 AND Ind.3 = F.S.2 AND Ind.4 = F.S.0 ) THEN Sig1 = 0.3243;
<-82.970 | 71.010>; <11.943 | 20.184>; <-19.786 | 34.376>; <-6.900 | 0.720>;

Pat#     Exp. Comp. Act. Err
186 -0.964 17.323 -3.409 -1.266 -1 -0.204 0.29 0 0.80
1096 -11.120 17.903 3.003 -1.260 -1 -0.040 0.32 0 0.96
1293 6.201 18.102 9.173 -1.344 1 0.290 0.31 0 0.71
2176 -1.486 17.785 1.375 -1.323 -1 -0.013 0.33 0 0.99
192 16.218 17.985 5.874 -1.342 1 0.319 0.28 0 0.68
2193 15.607 16.726 -0.611 -1.259 1 0.035 0.24 0 0.96
2409 -3.418 18.368 0.686 -1.221 1 0.049 0.24 0 0.95
2460 12.210 16.640 8.399 -1.187 1 0.138 0.32 0 0.86
2511 11.368 16.495 17.632 -1.257 1 0.148 0.21 0 0.85

1376 9.088 17.668 13.571 -1.329 -1 0.236 0.29 1 1.24
2022 -10.999 17.546 -1.087 -1.200 1 -0.214 0.30 1 1.21
050 14.053 18.345 -1.776 -1.309 -1 0.127 0.17 1 1.13
2065 15.401 16.831 -2.123 -1.260 -1 0.008 0.22 1 1.01
2288 3.260 17.128 -6.032 -1.270 1 -0.216 0.23 1 1.22
2422 -6.950 18.217 13.441 -1.333 -1 0.233 0.28 1 1.23
2436 18.142 17.724 -4.127 -1.189 -1 0.055 0.17 1 1.06

--------------------- Mean value : 0.000 Min value : -1.000 Max value : 1.000 Conclusion value : 0.324

back to top

These mean that rule #31 was seldom used (one bar only), rule #171 has been made active 16 times during training and produced a 56% rate of the good answer (44% in error).The error occurred on patterns in italic.

The same results are available for test data.
You can examine anything wrong using this method,  compare the behavior of any rule on any pattern between train and test data, but it is not mandatory. This is an ultimate refinement available to those who want to verify what is really inside the black box and understand all of its subtle behavior.

We now want to stop the discourse and let you experiment by yourself with the free evaluation version.
What could be done is

Add a couple of indicators (a first difference on DMI or K%, on ADX, a volatility indicator, a volume based indicator).Usually around 5 inputs is a fair number. No need to use 14 indicators that are partially redundant.

Use the TRAIN command than can enhance a solution by refining the neurofuzzy rules.

Try to train with a different Evaluation function from the performance Summary. Chose the one that could highlight the weakness of the Equity curve.

You may consider using several neurofuzzy systems into a big one (feasible in TradeStation only). Use a multiple vote in this case.

You can retrain the neurofuzzy system within TradeStation under any condition that you are able to write in Easy Language. This is a time consuming task, but very interesting and promising. Being done after a fairly good system was found, anyway.

You may train different neurofuzzy systems and switch them in TradeStation.

Possibilities are endless and only limited to your imagination...

Use different indicators. The examples given here are not the best available. They were used because anyone knows them and had used them in the past with probably fewer successes.

back to top


Not at all!
Here are the details of the whole operation

Task#
Time to
completion
on a
Pentium II
300Mhz
Difficulty
level:
0=
obvious
to anyone.

5= Obvious to Einstein.

TASK (OPERATION) DETAILS

1

2 min

1

We have built a training ASCII file (*.TSD)
from the TradeStation template provided, like below
. You just had to provide the name of the indicator and the output file name.

maketsd2.gif (3705 bytes)

2

15 s
back to top

0

We have opened The Assistant version 2
(or simply double click on the ASCII TSD file, it will run the Assistant)
and used the very simple Command Panel:

cpanel2.gif (5434 bytes)

3

15 min+coffee

0

A few clicks later (LOAD,..EXPLORE), the Assistant was doing its automated search, stored the results and produced the comprehensive reports that you have already seen in the various screen shots above.

4

1 min

1

We have made a new ASCII TSD file
using the same TradeStation template to get unseen data for testing.

maketsd3.gif (4075 bytes)

5 min
back to top
1

We used the same template to build any TSD ASCII file for use in the SAFIR-X Assistant for Expert Traders. Only the indicators and filename were modified.
This applied to SP500 10 min data  (1997, 1998) and Matif CAC40 10 min futures (1997,1997).
The TradeStation templates provided can also access to your indicators directly from the Power Editor.The above versions are EASY versions, without programming needs.

5

1 min

0

We loaded the new ASCII TSD file in the Assistant
using the same Command Panel than  Task#2

cpanel3.gif (5890 bytes)

6

10 to 20min+coffee

1 to 3
( I Can't say for you!)

...click on CHECK, and all the solutions were tested, stored, displayed on unseen data.
Once finished, we examined and  saved (as a*.FZB file) the best solution  of our choice for further use in TradeStation.

7

5 min

back to top

1

Running the neurofuzzy system in TradeStation
implies to use a similar template to the one used to build the ASCII file:
Provide the same indicators to it and the name of the fuzzy description file (here web3.FZB)

runfzb.gif (3961 bytes)



Like any other trading system...You get buy sell arrows, Performance Summary, Active Orders, like if it had been a moving average crossover system.
The results are the same than if you were testing in the Assistant:

For ending, here is a comparative screen copy of another system built  with the Assistant running in TradeStation 4 .
(With the  above templates using another set of "gambling indicators").

sol21.gif (22774 bytes)
SAFIR-X display
Indic1(dmiplus(14)), Indic2(DMIminus(14)), Indic3(slowd(20)), Indic4(rsi(c,5));
SP500 961202-970613 10 min
Training was made on the first half of the file.Buy Sell signals display as paintbars on price data
back to top

 

sol21TS.gif (40710 bytes)
click on the above  image to get a larger picture
TradeStation 4 display (same neurofuzzy system, same data, same costs)

Indic1(dmiplus(14)), Indic2(DMIminus(14)), Indic3(slowd(20)), Indic4(rsi(c,5));
You should be able to recognize the last third of the Equity Curve(white) shown in the previous SAFIR-X picture,
( TradeStation do not display all the  Equity Curve)

The above examples  only represents  least   performance that  SAFIR-X version 2 should achieve using such trivial indicators, provided that  you select them with some basic logic sense.  Better is not so difficult with it...
back to top


For more information, download, please point your browser to

http://www.sirtrade.com

back to top

Copyright © 1998-99 Pierre Orphelin
Sirtrade International
All rights reserved