OPEN-SOURCE SCRIPT

SHAAKUNI INDICATOR

//version=5
indicator("Simple Moving Average Crossover", overlay=true)

// Input for Moving Averages
fastLength = input.int(10, title="Fast MA Length")
slowLength = input.int(20, title="Slow MA Length")

// Calculating Moving Averages
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)

// Plotting Moving Averages
plot(fastMA, color=color.green, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")

// Highlight Buy/Sell Signals
buySignal = ta.crossover(fastMA, slowMA)
sellSignal = ta.crossunder(fastMA, slowMA)

plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.new(color.green, 0), style=shape.labelup, text="BUY")
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.new(color.red, 0), style=shape.labeldown, text="SELL")
almaaverageCandlestick analysisChart patternsmoving_average

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer