I stumbled upon this forum by searching for some of the momentum strategies by Nick Radge (thechartist.com.au), I found @Zachc 's brilliant post on the Bollinger Bands BReakout strategy which Nich wrote about in his book "Unholy Grails", I would like to thank @Zachc and the forum members responding and enriching his post.
I was looking for an implementation of the "Weekend Trend Trader" strategy from the book with the same title by the same Author.
I decided to tweak the code from @Zachc and I share the modified code below.
First some general parameters of this strategy, details for which you can read in the book Weekend trend trader Ebook by Nick Radge
General info about the strategy:
The strategy is a designed for long term momentum (trend) trading and with minimum trading activity in mind, only weekly signals are reviewed after the close and trades are placed for Monday at the open. Day or Intraday signals are irrelevant for this strategy.
This strategy is long only.
Recommended allocation by the author is 5% of total account capital on each position.
The strategy calculates trailing stops but the author recommends not to enter them as stop loss orders on your trading system but only to place the sell order if needed after the week's close to avoid potential whipsaws on the daily action.
Criteria for trade entry:
Criteria for trade exit:
Ideas for scanning for potential stocks:
I tried to combine 20 weeks high with Rate of change > 30% but the output of such a scan was very limited (perhaps due to current volatility in the markets. A more reliable scanner I found was to scan for ROC >10% over last 20 weeks and for stocks at least 10% above their 200 DMA.
You can use other momentum scanners and let me know if you find something relevant.
Snapshots:
A snapshot from how it looks (which is very familiar to the Bollinger BAnd BReakout by @Zachc as it's the same code pretty much with a tweak of the rules of course)
Code:
I was looking for an implementation of the "Weekend Trend Trader" strategy from the book with the same title by the same Author.
I decided to tweak the code from @Zachc and I share the modified code below.
First some general parameters of this strategy, details for which you can read in the book Weekend trend trader Ebook by Nick Radge
General info about the strategy:
The strategy is a designed for long term momentum (trend) trading and with minimum trading activity in mind, only weekly signals are reviewed after the close and trades are placed for Monday at the open. Day or Intraday signals are irrelevant for this strategy.
This strategy is long only.
Recommended allocation by the author is 5% of total account capital on each position.
The strategy calculates trailing stops but the author recommends not to enter them as stop loss orders on your trading system but only to place the sell order if needed after the week's close to avoid potential whipsaws on the daily action.
Criteria for trade entry:
- Stock must be making 20 week High
- Stock's Rate of Change must be >= 30%
- Market Index close price must be higher than its 10 Week moving average (implemented by an index filter on SPX, NDX, RUT or whatever is the relevant index)
Criteria for trade exit:
- If the market index is still positive (close of SPX for example > 10 Week average) then the recommeded trailing stop is 40% below the highest weekly close.
- If the market index turns negative (close of SPX for example < 10 week average) then the recommended trailing stop is moved to 10% below the highest weekly close.
- The trailing stop is never moved down, always moved up
- If market recovers after a negative turns we will not change the trailing stop unless the new trailing stop is higher than the older one.
- sell orders are not entered on the trading platform untill the review of the weekly signals after the Friday close and then any sell orders neede are placed on Monday.
Ideas for scanning for potential stocks:
I tried to combine 20 weeks high with Rate of change > 30% but the output of such a scan was very limited (perhaps due to current volatility in the markets. A more reliable scanner I found was to scan for ROC >10% over last 20 weeks and for stocks at least 10% above their 200 DMA.
You can use other momentum scanners and let me know if you find something relevant.
Snapshots:
A snapshot from how it looks (which is very familiar to the Bollinger BAnd BReakout by @Zachc as it's the same code pretty much with a tweak of the rules of course)
Code:
Code:
##Nick Radge Weekend Trend Trader Strategy
##Credit to @Zachc for sharing his Bollinger BAnd BReakout strategy, the basis for this midfied code
##Strategy used on a Weekly timeframe, scan on Friday after close
#
## Entry conditions:
#---------------------
# 1) Stock makes new 20 weeks high
# 2) Market close is > 10 week MA of index
# 3) 20 Week Rate Of Change is >30%
# If stock satisfies all 3 conditions you may place your buy order for the Monday Open
#
## Exit conditions:
#-------------------
# 1) Initital trailing stop is set 40% below High of the closing Week
# 2) IF Market filter turns down then then stop is moved up to 10% of high of the recent week
# 3) Stops are always moved up and never down
# 4) IF market filter turns up the stop level is maintained until a new higher trailing stop moves higher.
# As per Nick's recommendation the stops are not actual stop loss orders entered into the market but a check that happens after Friday close and then if the exit is confirmed the exit order is placed on Monday at the Open
declare hide_on_intraday;
input roc = 10;
input market = {default SPX, NDX, RUT, DJX};
## Regime Filter
#Is the market this stock is apart of above the 10 Week MA
input Market_50Day_MA = 10; #50/5
def length = Market_50Day_MA;
def RF = SimpleMovingAvg(close(symbol = market), length);
plot closeMA = close(symbol = market) < RF;
def marClose = close(market);
AddLabel(1, Concat("Index: ", Concat(market, Concat(" " + marClose, " 200SMA= " + RF))), if marClose > RF
then Color.GREEN
else Color.RED);
## Confirmation rate of change
def rate = RateOfChange(roc);
## Stock making new 20 week high
input LenWkHigh = 20; # length of weekly highs to conisder, default 20
def Twentyweekhigh = close == Highest(close, LenWkHigh);
## Stop loss
input IniTrailStopFactor = 0.4; # stop is 40% below high if market regime is in uptrend
input MktDownTrailStopFactor = 0.1; # stop is 10% below high if market regime changes to downtrend
def loss = if marClose > RF
then Highest(close,19) * (IniTrailStopFactor)
else Highest(close,19) * (MktDownTrailStopFactor);
def exitsignal = close <= Highest(close,20)- loss;
########################################################################
## Trailing Stop
input trailType = {default modified, unmodified};
input firstTrade = {default long, short};
def state = {default init, long, short};
def trail;
switch (state[1]) {
case init:
if (!IsNaN(loss)) {
switch (firstTrade) {
case long:
state = state.long;
trail = close - loss;
case short:
state = state.short;
trail = close + loss;
}
} else {
state = state.init;
trail = Double.NaN;
}
case long:
if (close > trail[1]) {
state = state.long;
trail = Max(trail[1], close - loss);
} else {
state = state.short;
trail = close + loss;
}
case short:
if (close < trail[1]) {
state = state.short;
trail = Min(trail[1], close + loss);
} else {
state = state.long;
trail = close - loss;
}
}
plot TrailingStop = trail;
TrailingStop.SetPaintingStrategy(PaintingStrategy.POINTS);
TrailingStop.DefineColor("Buy", GetColor(0));
TrailingStop.DefineColor("Sell", GetColor(1));
TrailingStop.AssignValueColor(if state == state.long
then TrailingStop.color("Sell")
else TrailingStop.color("Buy"));
plot cross = close crosses below trailingstop;
cross.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
#end
###Plots###
plot buySignal = Twentyweekhigh and rate > roc and marClose > RF;
buySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buySignal.SetLineWeight(2);
buySignal.SetDefaultColor(Color.GREEN);
plot sellSignal = exitsignal;
sellSignal.SetpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_Down);
sellSignal.SetLineWeight(2);
sellSignal.SetDefaultColor(Color.Red);
AddOrder(condition = buySignal, type = OrderType.BUY_TO_OPEN, price = open[-1], name = "BuyOrder");
AddOrder(condition = sellSignal, type = OrderType.SELL_TO_CLOSE, price = open[-1], name = "SellOrder");
AddOrder(condition = cross, type = OrderType.SELL_TO_CLOSE, price = open[-1], name = "TrailStop");