SuperCharting
Sign in Get started Account Open charts

MAURYA 15M EMA SMA FIBONACCI

A Pine Script indicator by arvind84maurya_gmail.

//@version=6 indicator("MAURYA 15M EMA SMA FIBONACCI", overlay=true)

// Timeframe check if timeframe.period != "15" runtime.error("Please use this indicator on 15-minute chart only.")

// Moving averages ema50 = ta.ema(close, 50) sma50 = ta.sma(close, 50)

// Plot EMA and SMA plot(ema50, title="EMA 50", color=color.orange, linewidth=2) plot(sma50, title="SMA 50", color=color.green, linewidth=2)

// Candle position aboveBoth = close ema50 and close sma50 belowBoth = close < ema50 and close < sma50

plotshape(aboveBoth, title="Green Dot", style=shape.circle, location=location.belowbar, color=color.lime, size=size.tiny)

plotshape(belowBoth, title="Red Dot", style=shape.circle, location=location.abovebar, color=color.red, size=size.tiny)

// Buy and Sell signals buySignal = ta.crossover(close, math.max(ema50, sma50)) sellSignal = ta.crossunder(close, math.min(ema50, sma50))

plotshape(buySignal, title="BUY", style=shape.arrowup, location=location.belowbar, color=color.lime, size=size.small, text="BUY")

plotshape(sellSignal, title="SELL", style=shape.arrowdown, location=location.abovebar, color=color.red, size=size.small, text="SELL")

// First 15-minute candle of each day var float firstHigh = na var float firstLow = na

newDay = timeframe.change("D")

if barstate.isfirst or newDay firstHigh := high firstLow := low

// Fibonacci range priceRange = firstHigh - firstLow

fib0 = firstLow fib33 = firstLow + priceRange 0.333 fib50 = firstLow + priceRange 0.50 fib618 = firstLow + priceRange 0.618 fib100 = firstHigh fib161 = firstLow + priceRange 1.618 fib261 = firstLow + priceRange 2.618

// Negative Fibonacci levels fibN33 = firstLow - priceRange 0.333 fibN50 = firstLow - priceRange 0.50 fibN618 = firstLow - priceRange 0.618 fibN100 = firstLow - priceRange fibN161 = firstLow - priceRange 1.618 fibN261 = firstLow - priceRange 2.618

// Plot Fibonacci levels plot(fib0, "FIB 0", color=color.white, linewidth=2, style=plot.stylestepline) plot(fib33, "FIB 33.3", color=color.gray, style=plot.stylestepline) plot(fib50, "FIB 50", color=color.yellow, style=plot.stylestepline) plot(fib618, "FIB 61.8", color=color.aqua, linewidth=2, style=plot.stylestepline) plot(fib100, "FIB 100", color=color.white, linewidth=2, style=plot.stylestepline) plot(fib161, "FIB 161.8", color=color.lime, style=plot.stylestepline) plot(fib261, "FIB 261.8", color=color.lime, linewidth=2, style=plot.stylestepline)

plot(fibN33, "FIB -33.3", color=color.gray, style=plot.stylestepline) plot(fibN50, "FIB -50", color=color.yellow, style=plot.stylestepline) plot(fibN618, "FIB -61.8", color=color.aqua, style=plot.stylestepline) plot(fibN100, "FIB -100", color=color.white, style=plot.stylestepline) plot(fibN161, "FIB -161.8", color=color.red, style=plot.stylestepline) plot(fibN261, "FIB -261.8", color=color.red, linewidth=2, style=plot.stylestepline)

// Alerts alertcondition(buySignal, title="MAURYA BUY", message="MAURYA BUY Signal") alertcondition(sellSignal, title="MAURYA SELL", message="MAURYA SELL Signal")Akm