Premium oscillator custom signal – Signal School

LUX OSC custom signal

Today we will read an external indicator to create a custom signal based on an event that is not offered by the original indicator.

We will use Premium Oscillator from LuxAlgo.

Code:

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// ยฉ TheTradingParrot

//@version=5
indicator("LUX OSC")

line = input.source(close,"line")

long = input.string("long","mode",options = ["long","short"]) == "long"


lowest = ta.lowest(line, 100) 
highest = ta.highest(line, 100)

gap = input.float(4)

hline(gap)

movedown = ta.highest(lowest,40) - lowest
moveup = highest - ta.lowest(highest,40)

lowreset =  movedown > gap
highreset =  moveup > gap

plot(long ? movedown : moveup,"move down/up", color = color.yellow)

// t1 = input.int(10)
// t2 = input.int(12)

plot(long ? lowest : highest, color= color.white)

maxrsi = input.int(60)
minrsi = input.int(40)

rsi = ta.rsi(close, 14)
rsima = ta.sma(rsi , 14)
rsiXover = ta.crossover(rsi, rsima)
rsiXunder = ta.crossunder(rsi, rsima)

plotshape(long and lowreset and rsiXover and rsi < minrsi, "buy",shape.labelup, location.bottom, color.green, text = "b", textcolor = color.white)
plotshape(not long and highreset and rsiXunder and rsi > maxrsi, "sell",shape.labelup, location.bottom, color.red, text = "s", textcolor = color.white)

Crypto banter weekly RSI Stoch strategy

In this crypto banter video they show how to use Stochastic RSI to enter and exit the market in the wekly timeframe. We coded an indicator to automate sending you alerts for each entry and exit.

Code:

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// ยฉ TheTradingParrot

//@version=5
indicator("Crypto banter strategy")

smoothK = input.int(3, "K", minval=1)
smoothD = input.int(3, "D", minval=1)
lengthRSI = input.int(14, "RSI Length", minval=1)
lengthStoch = input.int(14, "Stochastic Length", minval=1)

src = input(close, title="RSI Source")
rsi1 = ta.rsi(src, lengthRSI)
k = ta.sma(ta.stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = ta.sma(k, smoothD)
plot(k, "K", color=#2962FF)
plot(d, "D", color=#FF6D00)

buysignal = ta.barssince(k < 15 ) < 5 and ta.crossover(k, d)
sellsignal = ta.barssince(k > 85 ) < 5 and ta.crossunder(k, d)

plotshape(buysignal, "buy",style = shape.labelup,location = location.bottom, color=color.green,text="b", textcolor=color.white)
plotshape(sellsignal, "sell",style = shape.labeldown,location = location.top, color=color.red,text="s", textcolor=color.white)

hline(15)
hline(85)

Featured products and TTP memberships