This is a reversal trading strategy based on the Laruent Channel indicator. It calculates the highest and lowest prices over a certain period of time in the past to determine if the current price is in the overbought or oversold area. If the price is close to the upper or lower rail, it will open a position in the opposite direction and wait for the price to return to the middle line.
The strategy is mainly based on two indicators: PercentR indicator (%R) and Laruent Channel rails.
The PercentR indicator shows the distance between the current closing price and the highest and lowest prices over the most recent period. The value range is from 0 to -100. A value close to 0 means the current closing price is near the highest point recently. And a value close to -100 means the current closing price is near the lowest price recently.
The Laruent Channel consists of upper rail, middle line and lower rail. The upper rail equals the highest price over the most recent period. The lower rail equals the lowest price over that period. The middle line is the mean of the upper and lower rails. If the price exceeds the upper rail, it is considered overbought. If the price is below the lower rail, it is considered oversold.
The strategy first calculates the PercentR indicator and Laruent Channel rails, then uses the two indicators to determine if the current status is overbought or oversold:
If the current status is neither overbought nor oversold, it will long at market open. And close the position before market close on the same day.
By capturing the price reversal, it can make profits in short term.
Risks can be reduced by optimizing parameters, adjusting order placement time, or combining with other indicators.
In general, this strategy is quite simple and practical. It is designed based on the reversal trading idea and suitable for short term frequent trading. There is large room for optimization. More technical indicators can be introduced for combination. And automatic stop loss mechanisms can also be established to control risks.
/*backtest start: 2023-11-04 00:00:00 end: 2023-12-04 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Binance","currency":"BTC_USDT"}] */ //@version=4 // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © zweiprozent original strategy by larry williams strategy("Daily PercentR Strategy", overlay=false) D_High = security(syminfo.tickerid, 'D', high[1]) D_Low = security(syminfo.tickerid, 'D', low[1]) D_Close = security(syminfo.tickerid, 'D', close[1]) D_Open = security(syminfo.tickerid, 'D', open[1]) LowMarker = input(-87,"Low Marker",input.integer) HighMarker = input(-20,"High Marker",input.integer) length = input(title="Length", type=input.integer, defval=3) src = input(close, "Source", type = input.source) _pr(length) => max = highest(length) min = lowest(length) 100 * (src - max) / (max - min) percentR = _pr(length) obPlot = hline(LowMarker, title="Upper Band", color=#606060) hline(-50, title="Middle Level", linestyle=hline.style_dotted, color=#606060) osPlot = hline(HighMarker, title="Lower Band", color=#606060) fill(obPlot, osPlot, title="Background", color=color.new(#9915ff, 90)) plot(percentR, title="%R", color=#3A6CA8, transp=0) // Go Long - if percentR is not overbought/sold ordersize=floor(strategy.equity/close) if percentR<HighMarker and percentR>LowMarker strategy.entry("Long", strategy.long,comment="Long") //exit at end of session if low[0]<high[0] strategy.close("Long", comment="exit")