Strategy · Pine Script v5 · Own pane

SCTR & ONeil + RSI strategy

by PipC· code credited to philchan2008

This strategy calculates a StockCharts Technical Rank metric alongside an O'Neil-style relative strength rating, plotting both curves in a separate pane.

View on GitHub

GitHub stars8on the repository
Pine versionv5runs as is
Lines of code278
Settings22inputs
LicenceNone statedfile: MPL-2.0
Last update4 years ago20 Aug 2022

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

278 lines of Pine Script v5 from TradingView/SCTR_ONeilRS.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

SCTR_ONeilRS.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © philchan2008

//@version=5
strategy("SCTR & ONeil + RSI strategy", margin_long=100, margin_short=100, shorttitle="SCTR+RSI", overlay = false, format=format.price, precision       = 1)

//longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
//if (longCondition)
//    strategy.entry("My Long Entry Id", strategy.long)

//shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
//if (shortCondition)
//    strategy.entry("My Short Entry Id", strategy.short)

//
tradeMaxAmount = input.int(title="Trading Amount", step=1000, defval=10000)

strategyOrderType = input.string(title="Strategy Order Type", defval="ST+RSI", options=["ST+RSI","ST","RSI","ST||RSI"])

value = input (close, "value")
Fc = input(3,"Multiplier")
LT_Rate = input (60,"LT_% Rate")
MT_Rate = input (30,"MT_% Rate")
ST_Rate = input (10,"ST_% Rate")
//Long term input
LT_EMA = input (200,"LT_EMA")
LT_ROC = input (125, "LT_ROC")
//Middle term
MT_EMA = input (50,"MT_EMA")
MT_ROC = input(20,"MT_ROC")
//Short term input
ST_EMA = input (9,"ST_EMA")
ST_RSI = input(14,"ST_RSI")
//Long term integer
LT_EMAV = ((value - ta.ema(value,LT_EMA)) / ta.ema(value,LT_EMA))*100
LT_ROCV = ta.roc(value,LT_ROC)

//Middle term integer
MT_EMAV = (value - ta.ema(value,MT_EMA)) / ta.ema(value,MT_EMA)
MT_ROCV = ta.roc(value,MT_ROC)
//Short term integer
ST_EMAV = ((value - ta.ema(value,ST_EMA)) / ta.ema(value,ST_EMA))*100
ST_RSIV = (ta.rsi(value,ST_RSI))-50
//
LT_Val = LT_Rate*0.01*((LT_EMAV + LT_ROCV)/2)
MT_Val = MT_Rate*0.01*((MT_EMAV + MT_ROCV)/2)
ST_Val = ST_Rate*0.01*((ST_EMAV + ST_RSIV)/2)
SCTR = 50+(Fc*(LT_Val + MT_Val + ST_Val))
SCTRV = SCTR >= 0.1 and SCTR <= 99.9 ? SCTR : SCTR > 99.9 ? 99.9 : SCTR < 0.1 ? 0.1 : na
//SCTR2 = SCTR > 120 ? ( SCTR > 200 ? SCTR / 4 : SCTR / 2) : SCTR < 0 ? ( SCTR / 3 ) : SCTR
CL = 50
LINE_COLOR= SCTRV >= 99 ? color.aqua : SCTRV > 80 ? color.lime : SCTRV > 50 ? color.gray : color.orange
plot(SCTRV,"SCTR",color =LINE_COLOR, linewidth=1, style=plot.style_stepline, transp=20)
//plot(SCTR2,"SCTR Project", color=gray)
plot(CL,"CL",color = color.blue, linewidth = 1 )


price = close

//  1 Wk – 5 trading days
//  1 Mos – 21 Days
//  3 Mos – 63 Days
//  6 Mos – 126 Days
//  12 Mos – 252 Days

v_year    = price-price[252] < 0 ? 0 : price-price[252]
v_nine    = price-price[189] < 0 ? 0 : price-price[189]
v_six     = price-price[126] < 0 ? 0 : price-price[126]
v_three   = price-price[63 ] < 0 ? 0 : price-price[63 ]
v_weighted=  ((2*v_three) + v_six + v_nine + v_year)/4 < 0 ? 0 : ((2*v_three + v_six + v_nine + v_year)/4)

h = ta.highest(high, 252)
l = ta.lowest(low, 252)
hilo = math.abs(h-l)
calc = v_weighted/ hilo
middleLevel = 50

plot(middleLevel, title="Middle Level", color=color.white, linewidth=1, style=plot.style_line)

plot(0, title="Zero Level", color=color.new(color.red,80), linewidth=1, style=plot.style_line)
plot(100, title="100 Level", color=color.new(color.green,80), linewidth=1, style=plot.style_line)

rsrank = math.round(100* calc)



//rs10avg = sma(rsrank, 10)
//rs20avg = sma(rsrank, 20)
//rs50avg = sma(rsrank, 50)
//rs100avg = sma(rsrank, 100)

//plot(rs10avg, title="RS 10", color=color.teal, linewidth=2, style=plot.style_line)
//plot(rs20avg, title="RS 20", color=color.aqua, linewidth=2, style=plot.style_line)
//plot(rs50avg, title="RS 50", color=color.orange, linewidth=2, style=plot.style_line)
//plot(rs100avg, title="RS 100", color=color.red, linewidth=2, style=plot.style_line)

plot(ta.ema(rsrank,7),title="7",color=#f7df9b,linewidth=1,transp=0)
plot(ta.ema(rsrank,14),title="14",color=#f1c789,linewidth=1,transp=30)
plot(ta.ema(rsrank,21),title="21",color=#e59a67,linewidth=1,transp=30)
plot(ta.ema(rsrank,28),title="28",color=#d66e46,linewidth=1,transp=30)
plot(ta.ema(rsrank,35),title="35",color=#c14c32,linewidth=1,transp=30)
plot(ta.ema(rsrank,42),title="42",color=#a43328,linewidth=1,transp=30)
plot(ta.ema(rsrank,49),title="49",color=#861f24,linewidth=1,transp=30)
plot(ta.ema(rsrank,56),title="56",color=#711120,linewidth=2,transp=0)

plot_color = rsrank > ta.ema(rsrank,7) ? (rsrank > 50 ? color.green : color.white) : color.red

//if RSRank > 80 then color.dark_green else
//                       if RSRank > 60 and RSRank <= 80 then createcolor(0,175,0) else
//                       if RSRank > 40 and RSRank <= 60 then color.gray else
//                       if RSRank > 20 and RSRank <= 40 then CreateColor(220, 0,0) else
//                       if RSRank <= 20 then CreateColor(150, 0,0) else
//                       color.white

plot(rsrank, title="RS Rank", color=plot_color, style=plot.style_line, linewidth=2)


ma(source, length, type) =>
    switch type
        "SMA" => ta.sma(source, length)
        "Bollinger Bands" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "SMMA (RMA)" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)

rsiLengthInput = input.int(14, minval=1, title="RSI Length", group="RSI Settings")
rsiSourceInput = input.source(close, "Source", group="RSI Settings")
maTypeInput = input.string("SMA", title="MA Type", options=["SMA", "Bollinger Bands", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="MA Settings")
maLengthInput = input.int(14, title="MA Length", group="MA Settings")
bbMultInput = input.float(2.0, minval=0.001, maxval=50, title="BB StdDev", group="MA Settings")

up = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput)
down = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
rsiMA = ma(rsi, maLengthInput, maTypeInput)
isBB = maTypeInput == "Bollinger Bands"

plot(rsi, "RSI", color=color.new(rsi>rsiMA?#00ff2f:#fd2280,10), style=plot.style_circles, linewidth=1)
plot(rsiMA, "RSI-based MA", color=color.new(rsiMA>rsiMA[1]?color.white:color.gray,10), style=plot.style_line, linewidth=1)
rsiUpperBand = hline(70, "RSI Upper Band", color=#787B86)
hline(50, "RSI Middle Band", color=color.new(#787B86, 80))
rsiLowerBand = hline(30, "RSI Lower Band", color=#787B86)
fill(rsiUpperBand, rsiLowerBand, color=color.rgb(126, 87, 194, 90), title="RSI Background Fill")
bbUpperBand = plot(isBB ? rsiMA + ta.stdev(rsi, maLengthInput) * bbMultInput : na, title = "Upper Bollinger Band", color=color.green)
bbLowerBand = plot(isBB ? rsiMA - ta.stdev(rsi, maLengthInput) * bbMultInput : na, title = "Lower Bollinger Band", color=color.green)
fill(bbUpperBand, bbLowerBand, color= isBB ? color.new(color.green, 90) : na, title="Bollinger Bands Background Fill")


var _rsiBuy = false
var _rsiSell = false
var _stBuy =false
var _stSell = false

var RSIBuySignal = false
RSIBuySignal :=  math.avg(rsi, rsi[1], rsi[2]) > math.avg(rsi[3], rsi[4], rsi[5]) and math.avg(rsi, rsi[1], rsi[2]) > math.avg(rsiMA, rsiMA[1], rsiMA[2]) and  math.avg(rsi[3], rsi[4], rsi[5]) < math.avg(rsiMA[3], rsiMA[4], rsiMA[5]) //rsi > rsi[2] and rsi[2] > rsi[3] and rsi[3] < rsi[4] and rsi[4] < rsiMA[4] and rsi[1] > rsiMA[1] //and rsi[3] < rsiMA[3] and rsi[2] > rsiMA[2]

var label _laRsiBUY = na
if RSIBuySignal
    _rsiBuy := true
    _rsiSell := false
    label.delete(_laRsiBUY)
    _laRsiBUY := label.new(x=time, y=rsi, text="RSI", xloc=xloc.bar_time, yloc=yloc.price, color=color.new(color.green,80), textcolor=color.green, size=size.small, style=label.style_label_upper_left)
plot((RSIBuySignal) and close > high[1]+syminfo.mintick ? rsi: na, title="Buy Signal", color=plot_color, linewidth=2, style=plot.style_circles)

var RSISellSignal = false
RSISellSignal := math.avg(rsi, rsi[1], rsi[2]) < math.avg(rsi[3], rsi[4], rsi[5]) and math.avg(rsi, rsi[1], rsi[2]) < math.avg(rsiMA, rsiMA[1], rsiMA[2]) and  math.avg(rsi[3], rsi[4], rsi[5]) > math.avg(rsiMA[3], rsiMA[4], rsiMA[5])  //rsi < rsi[2] and rsi[2] < rsi[3] and rsi[3] > rsi[4] and rsi[4] > rsiMA[4] and rsi[1] < rsiMA[1] //and rsi[3] < rsiMA[3] and rsi[2] > rsiMA[2]

var label _laRsiSELL = na
if RSISellSignal
    _rsiSell = true
    _rsiBuy := false
    label.delete(_laRsiSELL)
    _laRsiSELL := label.new(x=time, y=rsi, text="RSI", xloc=xloc.bar_time, yloc=yloc.price, color=color.new(color.red,80), textcolor=color.red, size=size.small, style=label.style_label_lower_right)
plot( (RSISellSignal) and close < low[1]-syminfo.mintick ? rsi: na, title="Sell Signal", color=plot_color, linewidth=2, style=plot.style_circles)

//SCTRV
//ta.ema(rsrank,7) ta.ema(rsrank,56)

STBuySignal = (ta.crossover(ta.ema(rsrank,5), ta.ema(rsrank,14)) or (ta.crossover(rsrank, ta.ema(rsrank,56)) ) ) and (rsi > rsiMA or SCTRV > 40)
STSellSignal = (ta.crossunder(ta.ema(rsrank,5), ta.ema(rsrank,14)) or (ta.crossunder(rsrank, ta.ema(rsrank,56)) ) or ta.crossunder(rsi, rsiMA) ) and (SCTRV < 80 or rsi < rsiMA)

tranBg = SCTRV < 5 ? 85 : SCTRV < 10 ? 88 : SCTRV < 20 ? 92 : SCTRV < 50 ? 98 : SCTRV > 85 ? 88 : 92
bgColor = ( ta.ema(rsrank,5) > ta.ema(rsrank,14) or rsrank > ta.ema(rsrank,56) ) and (rsi > rsiMA or SCTRV > 40) ? color.new(color.lime,tranBg) : color.new(color.red,tranBg)
bgcolor(bgColor)


//plotshape( STBuySignal  ? rsrank : na, title="UpTrend Begins",   location=location.absolute, style=shape.triangleup,   size=size.tiny, color=color.green)
//plotshape( STSellSignal ? rsrank : na, title="DownTrend Begins", location=location.absolute, style=shape.triangledown, size=size.tiny, color=color.red)


var label _laBUY = na
var label _laSELL = na

if (STBuySignal)
    _stBuy := true
    _stSell := false
    label.delete(_laBUY)
    //label.delete(_laSELL)
    //if close > high[1]+syminfo.mintick
    _laBUY := label.new(x=time, y=rsrank, text="", xloc=xloc.bar_time, yloc=yloc.price, color=color.new(color.green,80), textcolor=color.green, size=size.small, style=label.style_label_lower_right)
plot((STBuySignal) and close > high[1]+syminfo.mintick ? rsrank: na, title="Buy Signal", color=plot_color, linewidth=3, style=plot.style_circles)


if (STSellSignal)
    _stBuy := false
    _stSell := true
    //label.delete(_laBUY)
    label.delete(_laSELL)
    //if close < low[1]-syminfo.mintick
    _laSELL := label.new(x=time, y=rsrank, text="", xloc=xloc.bar_time, yloc=yloc.price, color=color.new(color.red,80), textcolor=color.red, size=size.small, style=label.style_label_upper_right)
plot( (STSellSignal) and close < low[1]-syminfo.mintick ? rsrank: na, title="Sell Signal", color=plot_color, linewidth=3, style=plot.style_circles)


if strategyOrderType == "ST+RSI"
    if (_rsiBuy and _stBuy and (STBuySignal or RSIBuySignal)) //and (strategy.opentrades == 0)
        strategy.entry(RSIBuySignal?"RSE":"STE", direction=strategy.long, stop=high, qty=tradeMaxAmount/(high+syminfo.mintick)) //*(100-initStopLossPrecent)/100, qty=tradeMaxAmount/high)
    if (STSellSignal or RSISellSignal) //and (strategy.position_size > 0) // or ((recentHigh - close) / recentHigh) > longStopLossPrecent/100
        strategy.exit(RSISellSignal?"RSX":"STX", stop=low)


if strategyOrderType == "ST||RSI"
    if (STBuySignal or RSIBuySignal) //and (strategy.opentrades == 0)
        strategy.entry(RSIBuySignal?"RSE":"STE", direction=strategy.long, stop=high, qty=tradeMaxAmount/(high+syminfo.mintick)) //*(100-initStopLossPrecent)/100, qty=tradeMaxAmount/high)
    if (STSellSignal or RSISellSignal) //and (strategy.position_size > 0) // or ((recentHigh - close) / recentHigh) > longStopLossPrecent/100
        strategy.exit(RSISellSignal?"RSX":"STX", stop=low)

if strategyOrderType == "ST"
    if (STBuySignal) //and (strategy.opentrades == 0)
        strategy.entry("STE", direction=strategy.long, stop=high, qty=tradeMaxAmount/(high+syminfo.mintick)) //*(100-initStopLossPrecent)/100, qty=tradeMaxAmount/high)
    if (STSellSignal) //and (strategy.position_size > 0) // or ((recentHigh - close) / recentHigh) > longStopLossPrecent/100
        strategy.exit("STX", stop=low)

if strategyOrderType == "RSI"
    if (RSIBuySignal) //and (strategy.opentrades == 0)
        strategy.entry("RSE", direction=strategy.long, stop=high, qty=tradeMaxAmount/(high+syminfo.mintick)) //*(100-initStopLossPrecent)/100, qty=tradeMaxAmount/high)
    if (RSISellSignal) //and (strategy.position_size > 0) // or ((recentHigh - close) / recentHigh) > longStopLossPrecent/100
        strategy.exit("RSX", stop=low)


showTradingTable=input.bool(title="Show Trading Table", defval=true)
TradingTableLayout=input.string(title="Trading Table Layout", defval="1x6", options=["1x6","6x2","2x3"])
TradingTablePosition=input.string(title="Trading Table Position", defval=position.top_center, options=[position.bottom_center, position.bottom_left, position.bottom_right, position.middle_center, position.middle_left, position.middle_right, position.top_center, position.top_left, position.top_right])
TradingTableSize=input.string(title="Trading Table Size", defval=size.normal, options=[size.auto, size.huge, size.large, size.normal, size.small, size.tiny])
if showTradingTable
    var label _laTradeSize = na
    label.delete(_laTradeSize)
    var _orderPrice = close
    _orderPrice := close
    var _orderSize = math.round(tradeMaxAmount/_orderPrice,0)
    _orderSize := math.round(tradeMaxAmount/_orderPrice,0)
    //_laTradeSize := label.new(x=time+1, y=ta.highest(high,20), text=str.format("Order Size {0,number,#} | ${1,number,#.##} / ${2,number,#.##}", _orderSize, _orderSize*_orderPrice, _orderPrice), xloc=xloc.bar_time, yloc=yloc.price, color=color.white, textcolor=color.black, size=size.small, style=label.style_label_lower_left)
    //label.set_x(_laTradeSize, label.get_x(_laTradeSize) + math.round(ta.change(time)*1.5))
    //label.delete(_laTradeSize[1])
    if TradingTableLayout == "6x2"
        var tbl = table.new(position=TradingTablePosition, rows=6, columns=2, border_width = 1)
        table.cell(tbl, 0, 0, 'Entry Price', bgcolor=color.new(#cccccc, 20), text_size=TradingTableSize)
        table.cell(tbl, 1, 0, str.tostring(_orderPrice, "$#.##"), bgcolor=color.new(color.yellow, 20), text_size=TradingTableSize)
        table.cell(tbl, 0, 1, 'Total Cost', bgcolor=#cccccc, text_size=TradingTableSize)
        table.cell(tbl, 1, 1, str.tostring(_orderSize*_orderPrice, "$#.#"), bgcolor=color.new(color.yellow, 20), text_size=TradingTableSize)
        table.cell(tbl, 0, 2, 'Order Size', bgcolor=color.new(#cccccc, 20), text_size=TradingTableSize)
        table.cell(tbl, 1, 2, str.tostring(_orderSize, "#.#"), bgcolor=color.white, text_size=TradingTableSize)
    if TradingTableLayout == "1x6"
        var tbl = table.new(position=TradingTablePosition, rows=1, columns=6, border_width = 1)
        table.cell(tbl, 0, 0, 'Entry Price', bgcolor=color.new(#cccccc, 20), text_size=TradingTableSize)
        table.cell(tbl, 1, 0, str.tostring(_orderPrice, "$#.##"), bgcolor=color.new(color.yellow, 20), text_size=TradingTableSize)
        table.cell(tbl, 2, 0, 'Total Cost', bgcolor=#cccccc, text_size=TradingTableSize)
        table.cell(tbl, 3, 0, str.tostring(_orderSize*_orderPrice, "$#.#"), bgcolor=color.new(color.yellow, 20), text_size=TradingTableSize)
        table.cell(tbl, 4, 0, 'Order Size', bgcolor=color.new(#cccccc, 20), text_size=TradingTableSize)
        table.cell(tbl, 5, 0, str.tostring(_orderSize, "#.#"), bgcolor=color.white, text_size=TradingTableSize)
    if TradingTableLayout == "2x3"
        var tbl = table.new(position=TradingTablePosition, rows=2, columns=3, border_width = 1)
        table.cell(tbl, 0, 0, 'Entry Price', bgcolor=color.new(#cccccc, 20), text_size=TradingTableSize)
        table.cell(tbl, 0, 1, str.tostring(_orderPrice, "$#.##"), bgcolor=color.new(color.yellow, 20), text_size=TradingTableSize)
        table.cell(tbl, 1, 0, 'Total Cost', bgcolor=#cccccc, text_size=TradingTableSize)
        table.cell(tbl, 1, 1, str.tostring(_orderSize*_orderPrice, "$#.#"), bgcolor=color.new(color.yellow, 20), text_size=TradingTableSize)
        table.cell(tbl, 2, 0, 'Order Size', bgcolor=color.new(#cccccc, 20), text_size=TradingTableSize)
        table.cell(tbl, 2, 1, str.tostring(_orderSize, "#.#"), bgcolor=color.white, text_size=TradingTableSize)

Overview

SCTR & ONeil + RSI strategy evaluates long-term, medium-term, and short-term exponential moving average deviations, rate-of-change measurements, and relative strength index values. User settings configure lookback periods, component weightings, order types, maximum trade amount, and a visual dashboard table. The script does not define any stop loss or take profit orders, and the visible source code contains no active entry or exit execution rules.

Details

Published by

PipC on GitHub

Code credit

philchan2008, as written in the script's header

Type

Strategy, Pine Script v5

Draws

Separate pane below the chart

Category

Oscillators & momentum, Moving averages, Screeners & dashboards

Markets

Stocks

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Trading Amountint10000tradeMaxAmount
Strategy Order TypestringST+RSIstrategyOrderType
valuesourceclosevalue
Multiplierint3Fc
LT_% Rateint60LT_Rate
MT_% Rateint30MT_Rate
ST_% Rateint10ST_Rate
LT_EMAint200LT_EMA
LT_ROCint125LT_ROC
MT_EMAint50MT_EMA
MT_ROCint20MT_ROC
ST_EMAint9ST_EMA
Show all 22 settings
SettingTypeDefaultVariable
ST_RSIint14ST_RSI
RSI Lengthint14rsiLengthInput
SourcesourceclosersiSourceInput
MA TypestringSMAmaTypeInput
MA Lengthint14maLengthInput
BB StdDevfloat2.0bbMultInput
Show Trading TablebooltrueshowTradingTable
Trading Table Layoutstring1x6TradingTableLayout
Trading Table Positionstringposition.top_centerTradingTablePosition
Trading Table Sizestringsize.normalTradingTableSize
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

104 stars

This overlay strategy combines a machine-learning distance model with a MACD oscillator to open trades on the price chart. It compares recent history using cosine similarity or Euclidean and Lorentzian distance, then filters direction with selectable moving-av

Strategy v5 AI / machine learningOscillators & momentum
Updated 3 years ago · MIT GitHub repository of MLCEL and MACD Strategy

This long-only trend-following strategy combines Ichimoku Kinko Hyo components with higher timeframe moving average filters. It triggers long entries when price trades above a higher timeframe EMA and a bullish Tenkan-Sen cross above Kijun-Sen occurs under fav

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo Momentum Strategy
330 stars

MACD + Divergences [Alorse] is a momentum strategy that calculates the MACD oscillator and identifies regular and hidden divergences using pivot high and low points. It filters trade signals with dual Exponential Moving Averages (EMA 150 and 600) to ensure tra

Strategy v4 Oscillators & momentumDivergence Repaints
Updated 2 months ago · None stated GitHub repository of MACD + Divergences [Alorse]

MACD Crossover (tutorial)

by pineforge-4pass
193 stars

This strategy calculates the Moving Average Convergence Divergence indicator and plots the MACD line, signal line, and histogram in a separate pane. It enters long positions when the MACD line crosses above the signal line and enters short positions when it cr

Strategy v6 Oscillators & momentumMoving averages
Updated today · Apache-2.0 GitHub repository of MACD Crossover (tutorial)

8D Run

by hasnocool
106 stars

8D Run is a Pine Script momentum strategy inspired by Linda Bradford Raschke. It tracks consecutive price closes relative to a 5-period Simple Moving Average (SMA). When price remains above the SMA for 8 or more bars and then dips below it, the strategy enters

Strategy v5 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 8D Run

BTC Futures MACD

by iamrichardD
57 stars

This strategy plots a MACD oscillator in a separate pane and trades Bitcoin futures from zero-line and signal-line crosses. Optional early momentum signals, a volume filter, and a trend moving-average filter can confirm entries. It sizes positions as fixed con

Strategy v6 Oscillators & momentumMoving averages Repaints
Updated 1 year ago · Apache-2.0 GitHub repository of BTC Futures MACD

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers