April 2005 Newsletter

In this issue:

I. Beat the rising cost of gas

II. Featured add-on for NeuroShell Trader – Fuzzy Sets

III. Direct from the forum

IV. Fuzzy Sets – Commentary by CEO Steve Ward

V. One way to stop this newsletter

*******************************************************

I. Beat the rising cost of gas

Like the rest of you, we’ve been grumbling about the increase in gasoline prices. So we thought some extra $$$ in your pocket would be a good thing. That’s why we’re announcing a 15% discount off of the list price of the following products:

NeuroShell Trader
NeuroShell Trader Professional
NeuroShell DayTrader Professional
ALL NeuroShell Trader Add-ons

NeuroShell Predictor
NeuroShell Classifier
NeuroShell Run-Time Server
GeneHunter
AI Trilogy

ALL Upgrades

This sale DOES NOT apply to shipping costs, the NeuroShell Engine, AI College, consulting, previous purchases, products advertised by, but not sold by Ward Systems Group, or products not specifically stated as being included in the sale.

Use your savings to go out to dinner, go to the movies, play a round of golf, or buy your next tank of gas! Whatever you do, you have to act quickly. This sale only lasts until May 6, 2005.

Please note that neither our price lists, nor the online/downloadable ordering forms will show the sale prices. The discount WILL be applied to your order prior to processing your method of payment.

Note: We expect oil companies will not try to take advantage of this sale and will pay full price.

For more information, please visit our website.

*******************************************************

II. Featured add-on for NeuroShell Trader – Fuzzy Sets

Fuzzy logic was invented by L.A. Zadeh and further popularized by Bart Kosko. Fuzzy logic is not some theoretical idea that has yet to catch on. By 1990 the Japanese had over 100 real fuzzy control applications and products. The city of Sendai in Japan has controlled its subway with fuzzy logic since 1988. General Motors’ highly successful Saturn applies fuzzy logic for automatic transmission shift control. Duke University engineers have shown that intentionally imprecise rules of thinking can help hotel computers sell the right room to the right customer at the right time, thus boosting income.

Ward Systems Group introduced what we believe was the first commercial trading software to allow users to describe price movements with fuzzy logic statements (the Fuzzy Pattern Recognizer add-on). A user could essentially give NeuroShell instructions such as:

“Find patterns where the price rose, then dropped, then dropped sharply, then rose sharply.”

The Fuzzy Sets add-on is somewhat different in that it allows users to describe a combination of values of traditional indicators with fuzzy logic. With Fuzzy Sets the user can instruct NeuroShell with functions equivalent to statements like:

“Buy when the Stochastic %K indicator is very high, and the Commodity Channel Index is high, and the spread between two moving averages is low.”

The typical trading utilization of an indicator is to make decisions based upon whether that indicator (let’s say the Stochastic %K) is above or below some threshold. For example:

Buy when the STOCH%K > 70 and sell when the STOCH%K < 40 You could take that a step further and make decision rules such as the following: Buy when the STOCH%K is between 70 and 90 and sell when the STOCH%K is between 20 and 40. All of the rules above are sometimes called "crisp" rules, because they "break off" suddenly. In the last rule above, you are buying when the STOCH%K is 70 but not when it is 69. A human might still give consideration to buying when the STOCH%K reached 69, or even at a level of 65, although he would not consider it as strong as a buy as when STOCH%K = 70. In fact, a human would probably consider STOCH%K=80 to be a much stronger buy signal than STOCH%K=70. Fuzzy rules are a little different than crisp rules in that they do not break off suddenly. Let's consider the following example, where we will use the STOCH%K again. Suppose we have decided that STOCH%K can be considered to be in one of 5 categories or "fuzzy sets": 1. very low 2. low 3. medium 4. high 5. very high Then we could create "fuzzy" rules such as one of these two: Buy when STOCH%K is high and sell when STOCH%K is very low. Buy when STOCH%K is very high and sell when STOCH%K is medium. But then how can we really apply these fuzzy rules if we do not associate some numbers with the fuzzy sets? We can't, so at first we might think about giving each fuzzy set a range as follows: Very low = 0 to 19 Low = 20 to 39 Medium = 40 to 60 High = 61 to 80 Very high = 81 to 100 A little reflection about the ranges we just described, however, will reveal that we would still have crisp rules, because we suddenly break off from medium and go to high when STOCH%K goes from 60 to 61! The solution to this dilemma, and the basis of fuzzy logic, is to overlap the fuzzy sets in some way, as follows: Very low = 0 to 25 Low = 0 to 50 Medium = 25 to 75 High = 50 to 100 Very high = 75 to 100 You'll note that given any value of STOCH%K between 0 and 100, that value is considered to be in two fuzzy sets using our overlapping scheme above. For example, 70 is both medium and high. The FuzzyRange indicator tells us which fuzzy sets an indicator value (the indicator which is input into the FuzzyRange indicator) falls into on any particular bar. The FuzzyRange value is 0 (false) if a bar of the input indicator under consideration is not in a fuzzy set, and 1 (true) if it is in a fuzzy set. Let's take a closer look. FuzzyRange takes three parameters: Sets - the number of fuzzy sets we want to break the complete range of an indicator into Indicator - the indicator we want to break into fuzzy sets Set - the set number, from 1 to Sets The result (output) of the FuzzyRange indicator is either 1.0 (for true) or 0.0 (for false). So for example, the indicator: FuzzyRange(5,Stoch%K(High,Low,Close,5),3)=1.0 says that the input indicator Stoch%K(High,Low,Close,5) is in set 3 out of 5 sets on some particular bar. That would be equivalent to the medium set (when we are using names like very low, low, medium, high, and very high) since there are 5 sets. (The FuzzyRange indicator doesn't use the readable names). Similarly, the indicator: FuzzyRange(5,Stoch%K(High,Low,Close,5),4)=1.0 FuzzyRange(5,Stoch%K(High,Low,Close,5),5)=0.0 says that the same STOCH%K indicator is in set 4 (which is equivalent to high) on the same particular bar, but it is NOT in set 5. If we looked at all 5 possible sets on this bar we might see that: FuzzyRange(5,Stoch%K(High,Low,Close,5),1)=0.0 FuzzyRange(5,Stoch%K(High,Low,Close,5),2)=0.0 FuzzyRange(5,Stoch%K(High,Low,Close,5),3)=1.0 FuzzyRange(5,Stoch%K(High,Low,Close,5),4)=1.0 FuzzyRange(5,Stoch%K(High,Low,Close,5),5)=0.0 It would seem like we have built a conflicting situation with a STOCH%K values being in two fuzzy sets simultaneously until we realize that humans would consider 70 to be a strong medium and a weak high! We could actually rate the strength of the medium or the high, if we give strength a value from 0 to 1. Then we could say that an STOCH%K of 70 is both medium (strength 0.81) and high (strength 0.19) In fact that is exactly what the indicator FuzzySet does. FuzzySet is just like FuzzyRange in terms of how it is called, but it gives the strength (fuzzy set membership value) as a result instead of just true or false. FuzzySet also takes three parameters: Sets - the number of fuzzy sets we want to break the complete range of an indicator into Indicator - the indicator we want to break into fuzzy sets Set - the set number, from 1 to Sets So for example, the indicator: FuzzySet(5,Stoch%K(High,Low,Close,5),3)=0.81 gives the strength of the indicator Stoch%K(High,Low,Close,5) in set 3 out of 5 sets on some particular bar. That would be equivalent to the medium set (when we are using names like very low, low, medium, high, and very high) since there are 5 sets. (The FuzzySet indicator also doesn't use the readable names). Similarly, the indicator: FuzzySet(5,Stoch%K(High,Low,Close,5),4)=0.19 gives us the strength of the same STOCH%K indicator in set 4 (which is equivalent to high) on the same particular bar. If we looked at all 5 possible sets on this bar we might see that: FuzzySet(5,Stoch%K(High,Low,Close,5),1)=0.00 FuzzySet(5,Stoch%K(High,Low,Close,5),2)=0.00 FuzzySet(5,Stoch%K(High,Low,Close,5),3)=0.81 FuzzySet(5,Stoch%K(High,Low,Close,5),4)=0.19 FuzzySet(5,Stoch%K(High,Low,Close,5),5)=0.00 Note: The FuzzyRange and FuzzySet indicators are not restricted to using 5 sets. You can use any value equal to or greater than 2 for the parameter Sets. However, we do not recommend setting Sets higher than about 20, because you do not want to become too precise. The FuzzySets indicators (there are 9 of them named FuzzySets2, FuzzySets3, and so on up to FuzzySets10) are like multiple uses of the FuzzySet indicator. FuzzySets3, for example, is like using 3 FuzzySet indicators fuzzy-AND'ed together. An example use would be if you wanted a rule such as the following: Buy when RSI is low, Stoch%K is high, and the percent spread between IBM and Microsoft is very high. After reading about the FuzzySets indicators which do a Fuzzy-AND of the specified indicators, you might rightfully wonder if there is a fuzzy-OR capability. The ORSets indicators (there are 9 of them named ORSets2, ORSets3, and so on up to ORSets10) are exactly like the FuzzySets indicators, except that they do a fuzzy-OR instead of a fuzzy-AND. ORSets3, for example, would be useful if you wanted a rule such as the following: Buy when RSI is low, or Stoch%K is high, or the percent spread between IBM and Microsoft is very high. ******************************************************* III. Direct from the forum The following question from our NeuroShell Trader users' forum inspired Steve's commentary in this issue. Q. Since Steve Ward suggested that we ask for assistance for NST add-ons, I am would like to bring up an issue regarding the pattern Recognition add-on. I have seen other commercial programs refer to their ability to use Elliot Wave concepts in trading. One program in particular uses the ABC preliminary wave patterns to project entry and exit points. On the surface it would appear that the pattern recognition add-on should easily accomplish the same goal and more. However, in practice I have not been able to do so. Part of the problem is the way the add-on is structured to respond to rises and falls only. However, there are other variables that are required to identify a Elliott Wave initial pattern. For instance in a three segment pattern, segment 2 should not exceed the length of segment 1. Segment 2 should also not extend below the origin of segment 1 if the pattern is an upward moving pattern. As the add-on is structured, I know of no way to achieve this level of recognition. Certainly if there were other programming variables added which would allow for more constraints, this ABC pattern and multiple other patterns would be possible. If someone has a work around for this problem, I would be very happy to hear about it. A. Those other constraints you want are probably not hard with the usual NeuroShell indicators. I think I would approach this pattern recognition problem not with the Fuzzy Pattern Recognizer (FPR), but with the Fuzzy Sets (FS) addon. Think of the latter as the building blocks of the former, even though that isn't how we built them. You make you segments first, either with momentum across several bars, or with the regression slope through several bars. That way, you can make the segments any size you want. Use the save indicators feature with parameters hidden from user if you don't want the optimizer messing with segment sizes later (although you may not want to use the optimizer at all). Use FS to get these segments going in the directions you desire - fuzzily. Since you made the segments yourself, you can do various tests on them, like segment 2 not below segment 1, with the regular NeuroShell indicators. I suppose you could also use FPR if you let if find the segments first, then use the regular indicators to do other tests. But using FS you will probably have more control. ******************************************************* IV. Fuzzy Sets - Commentary by CEO Steve Ward Article III above is a question I recently answered on the NeuroShell Trader Forum on www.ward.net. It was a good question and it got me to thinking about how in many ways beyond Elliot Waves the Fuzzy Sets add-on can actually be a more powerful Fuzzy Pattern Recognizer. Lower level, but more powerful in the end. We really didn't think about those possibilities when we built fuzzy sets. So let's talk a little more in detail about how one would make a custom fuzzy pattern recognizer with Fuzzy Sets. Suppose we are looking for a rapid rise over 4 bars, an essentially flat line for 3 bars, and then a rapid drop over the next 4 bars. A kind of head and shoulders. There are at many ways to make a line segment and find the slope of it. The one I like is the use the indicator in the Regression category called: Linear Time Regression: Coefficient of Regression (slope) Sorry about the long intimidating name, but that just measures the slope of an imaginary line drawn through data for the past x bars, where you can set x as a parameter. Remember from high school algebra that slope is just the price change divided by the time in bars over which the price change was measured. (Surely you didn't forget that, did you?). If the price went down, the slope is negative. So for the right 4 bar shoulder, the slope is the 4 bar regression slope and you want it to be very negative. For the left shoulder, you want the 7 bar lag of the 4 bar regression slope, and you want it to be very positive. The head is the 3 bar regression slope lagged 4 bars. Now if you just want to test if these 3 slopes are in certain predetermined ranges, you can just use the A>B>C indicators and be done with it (where A is the lower range, B is the slope indicator, and C is the upper range). But that would be no fun, because we wouldn’t being fuzzifying things.

To fuzzify, you’d use either the FuzzyRange or the FuzzySet indicator applied to each regression slope. For a rapid rise you’d want the slope to be say in set 7 of 7 sets. For a rapid drop you might look to be in set 1 of 7 sets. You could look for the head to be in say set 6 of 11 sets, but if that doesn’t result in something flat enough for you, you could always go back to A>B>C for the top of the head.

If you wanted the right shoulder to be lower than the left one, you’d be better off drawing your imaginary line from the open of the first bar of a shoulder to the close of the last bar. That way you can compare the prices at either end to see which is higher.

If anybody wants to continue this discussion, let’s do it on the forum.

*******************************************************

V. One way to stop this newsletter

Just change your email address and don’t tell us.

*******************************************************

Was this article helpful?

Related Articles