Ext/Non EMA Signals
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © DustinL89
//@version=5    
indicator("Ext/Non EMA Signals", shorttitle="EMA Signals", overlay=true)
//for use on extended sessons

//get user input

regularemasource= input(title="Regular EMA", defval=close)
regularemalength= input(title="Regular EMA", defval=10)

extendedemasource= input(title="Extended EMA", defval=close)
extendedemalength= input(title="Extended EMA", defval=10)

//Get data
C = close
O = open 


//get extended and regular sesion info
textend = ticker.new (syminfo.prefix,syminfo.ticker,session.extended)
treg = ticker.new (syminfo.prefix,syminfo.ticker,session.regular)
extended = request.security(textend,timeframe.period, ta.ema(extendedemasource,extendedemalength),barmerge.gaps_on)
regular = request.security(treg,timeframe.period, ta.ema(regularemasource,regularemalength),barmerge.gaps_on)


//plotline
plot(extended,"Extended Session Line",color=color.new(color.red,0))
plot(regular,"Regular Session Line",color=color.new(color.red,0))




//Signal Identifier
GoShort = C >= O and C < extended and C < regular
GoLong = C <= O and C > extended and C > regular

//plot singals to chart

plotshape(GoLong, title="Bullish Signal", location=location.abovebar, color=color.new(color.green,0), style=shape.triangledown)
plotshape(GoShort, title="Bearish Signal", location=location.belowbar, color=color.new(color.red, 0), style=shape.triangleup)




