This flat base breakout was presented by Bill Pritchard in the January 2006 issue of Technical Analysis of Stocks and Commodities magazine. As Bill points out in the article, the flat base breakout is a classic trading system that has been proven to be a winner. The FBB presented by Bill uses a dual exponential moving average in the exit, and defines the FBB as a closing price that is higher than the highest high over 60 days.
As the flat base breakout generates few signals on individual stocks it is an ideal trading system for portfolio backtesting.
#An interpretation of the Flat Base Breakout (FBB) presented by Bill Pritchard in
#the January 2006 issue of Technical Analysis of Stocks and Commodities magazine.
#This system performs better when system order options are checked:
# Allow Multiple orders per symbol
# Implicit One Cancels All (OCA) per symbol
unless (Position) {
#no position - testing the entry rules
#Daily close for today is greater than maximum close over 60 days,
#starting yesturday
if (ClosePrice>Yesterday(Highest(Close,61))) {
#The daily close is less than $50 and greater than $2
if (ClosePrice<50 and ClosePrice>2) {
#The daily close for today is greater than daily open for today
#and the closeprice for today is greater than the close for yesturday
if (ClosePrice>OpenPrice and ClosePrice>Yesterday(Close)) {
#Daily volume for today is greater than or equal to minimum volume
#over 60 days (starting today) multiplied by 5
if (Today(Volume) >= Today(Lowest(Volume,60))*5) {
#Daily volume for today is greater than or equal to daily volume
#for yesturday multiplied by 3
if (Today(Volume)>=(Yesterday(Volume)*3)) {
#63-day exponential moving average of volume for yesturday is less
#than or equal to 500,000
if (Yesterday(EMA(Volume,63))<=500000) {
#Mark this bar on the chart
Markbar(Red);
#Place a buy stop order for the daily high price plus 25cents
#We leave money management/position sizing upto the money management
#object
BuyStop(HighPrice+0.25);
}
}
}
}
}
}
}
else {
#we have a position perform exit logic
#Maintain a stop loss of 7% below the entry price
PlaceStopLoss('7 Percent',EnterPrice-(EnterPrice / 100)*7);
#Sell on the open if the 3 bar EMA crosses under the 6 bar EMA
SellOpen if Crossunder(EMA(Close,3),EMA(Close,6));
}