((Bullish)) Candle below EMA 
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MINTYFRESH97

//@version=5
indicator(title="((Bullish)) Candle below EMA", overlay=true)

// Calculate moving averages
var g_ema    = "EMA Filter"
emaLength9    = input.int(title="9MA", defval=21, tooltip="Length of the EMA filter", group=g_ema)
emaLength50    = input.int(title="50EMA", defval=50, tooltip="Length of the EMA filter", group=g_ema)
emaLength100    = input.int(title="100EMA", defval=100, tooltip="Length of the EMA filter", group=g_ema)
emaLength200    = input.int(title="200EMA", defval=200, tooltip="Length of the EMA filter", group=g_ema)
// Create table
var table myTable = table.new(position.top_right, 5, 6, border_width=4)

if barstate.ishistory
    txt1 = "ONLY USE WHEN THE MARKET IS TRENDING \n" 
    

    table.cell(myTable, 0, 0, text=txt1, bgcolor=color.white, text_size=size.large  , text_color=color.lime)
    



fastMA = ta.ema(close, emaLength9)
fastMA50= ta.ema(close, emaLength50)
fastMA100= ta.ema(close, emaLength100)

// Get EMA filter
ema1 = ta.ema(close, emaLength200)
emaFilterLong = close >  ema1


swingLow1 = low == ta.lowest(low,12) or low[1] ==ta.lowest(low,12)

//longsignal

longsignal= ta.crossover(close, fastMA) 
longsignal1= ta.crossover(close, fastMA50) 
longsignal2= ta.crossover(close, fastMA100) 


bullishcandlesfilter =longsignal  and emaFilterLong
bullishcandlesfilter1 =longsignal1 and emaFilterLong
bullishcandlesfilter2 =longsignal2 and emaFilterLong



plotshape(bullishcandlesfilter1, style=shape.arrowup, color=color.lime, size=size.small, text="Below50ema", title="Bullish Price below 50ema" , location=location.belowbar)
barcolor(bullishcandlesfilter1 ? color.lime :na)
alertcondition(bullishcandlesfilter1, "Bullish Price below 50ema", "Bullish Price below 50ema{{ticker}}")

plotshape(bullishcandlesfilter2, style=shape.arrowup, color=color.lime, size=size.small, text="Below100ema", title="Bullish Price below 100ema" , location=location.belowbar)
barcolor(bullishcandlesfilter2 ? color.lime :na)
alertcondition(bullishcandlesfilter2, "Bullish Price below 100ema", "Bullish Price below 100ema{{ticker}}")



plotshape(bullishcandlesfilter, style=shape.arrowup, color=color.lime, size=size.small, text="Below21ema", title="Bullish Price below 21ema" , location=location.belowbar)
barcolor(bullishcandlesfilter ? color.lime :na)
alertcondition(bullishcandlesfilter, "Bullish Price below 21ema", "Bullish Price below 21eam{{ticker}}")

