Site Meter The Lawyer Trader: June 2011

Thursday, June 2, 2011

Fresh Strong Buy Signal on the EUR/USD and some Think Script Code

I'm long the Eur/Usd...my TrendFuzz system just switched from Buy to Strong Buy. The pair may make a run for it's recent highs, which would make for a great trade.  Here's the chart:

Note the bars changed from dark green to bright green indicating a "strong buy" signal.  This combined with the Trend Confirm Dots (a separate trend following system) makes the pair look bullish right now.

A quick explanation of the TrendFuzz system is in order and I'll briefly describe it since I've been referencing it for a little while now.  TrendFuzz, is a trend following system that combines a market thermometer indicator or thermo with a volatility break out system.  The thermo measures an instrument's ability to make higher highs or lower lows (similar to what A. Elder described in Come Into My Trading Room) and it combines this score with another score based on current price in relation to a couple of past prices..like prices from 20 and 50 bars ago.  So, one part of the trendfuzz indicator is based on an increased/decreased average of thermo scores and the other part is just a volatility break out confirmation...the instrument needs to move 2x its historic volatility kind of thing.

This indicator is great for catching trends and does a decent job of minimizing risk.  The volatility filter helps filter out moves that are likely to whip saw...although not all of the moves get filtered out.  The "fuzz" in trend fuzz alludes to "fuzzy logic." This is because it is an adaptive system that can change its criteria for readings based on recent trading activity.  This means that an uptrend reading from today can have different criteria than an uptrend from a month ago...hence a fuzzy definition. 

I'm not going to share the code or the internals of the full system, but, I will share the basic code for the Thermo...which is what a good part of the system revolves around.  Some of the programming might be a little redundant and amateurish because, well, I'm not a professional programmer...just a self taught market junky that knows enough to get by.  The code used in the system is similar to this one, but it has been tweeked quite a bit.  This Thermo indicator is still rather interesting and can be useful to anyone interested in a new indicator. It uses a 52 Week High/Low score verbiage but its not really referencing the 52 week high/low..that is leftover from the original indicator.  Now can be set to look back at any bar you want..like 10 bars, 20 bars or even 100 bars back, just make sure the aggregation period on the chart is the same selected for the indicator.  Here's the code for thinkorswim:
####################################################
declare lower;

input ThermoAGPeriod = {default MONTH, MIN, HOUR, DAY, WEEK};
input ThermoLookBackBars = 12;
input PlotType = {default ExpMovingAverages, Standard};

def HighLowScore = 1000*((high-high[1])/(high[1])+
(low - low[1])/low[1]);

def A = highest(high(period = ThermoAGPeriod));
def B = lowest(low(period = ThermoAGPeriod));

def FiftyTwoWeekHigh = A[ThermoLookBackBars];

def FiftyTwoWeekLow = B[ThermoLookBackBars];

def FiftyTwoWeekScore = 10 * (((high
- FiftyTwoWeekHigh)/FiftyTwoWeekHigh) +
((low - FiftyTwoWeekLow)/FiftyTwoWeekLow));

def ThermoScore = HighLowScore + FiftyTwoWeekScore;

input MAPeriodShort = 9;
input MAPeriodLong = 50;

def EMA = ExpAverage(ThermoScore, MAPeriodShort);
def EMA2 = ExpAverage (ThermoScore, MAPeriodLong);

plot Line1;
Plot Line2;

Switch (PlotType) {
case ExpMovingAverages:
    Line1 = EMA;
    Line2 = EMA2;
case Standard:
    Line1 = ThermoScore;
    Line2 = ThermoScore;
}

def InvisibleLine=close*0;
plot Line3 = InvisibleLine;
Line3.hide();


addcloud(Line1, Line2, Color.CYAN, color.Dark_RED);
addcloud(Line2, Line3, Color.Dark_Gray, Color.Magenta);     

#####################################################

Enjoy and let me know if you have any questions.

TLT