Why was seclast code used in this script?
Why was this coded instead of the names of the colours - #F70317 , #008600
Here is the script would the added alerts I wrote work?
Script below
//@version=2
study("Bullish and Bearish Engulfing")
checkingHighsAndLows(position) =>
high >= high[position] and low <= low[position]
isBearishEngulfing(position) =>
checkingHighsAndLows(position) and open >= close[position] and open >= open[position] and close <= open[position] and close <= close[position]
isBullishEngulfing(position) =>
checkingHighsAndLows(position) and open <= close[position] and open <= open[position] and close >= open[position] and close >= close[position]
secLast = 1
barcolor(isBearishEngulfing(secLast)? #F70317: na)
barcolor(isBullishEngulfing(secLast)? #008600: na)
alertcondition(isBearishEngulfing(secLast), title='E Bear', message='E Bear')
alertcondition(isBullishEngulfing(secLast), title='E Bull', message='E Bull')