i want to trigger an alert or plot hline as soon as below conditions are met:
- the current candle did not cut the previous candle high
- the current candle price cuts below the low of previous candle
- the current candle is about to close (say 95% of time is passed)
Please help me :)
I am new to pinescript, trying to learn each day, so far i have below
ema100 = ta.ema(close,100)
currentcrossbelow = close < low[1]
previousdetached = low[1] > ema100[1]
bgcolor(currentcrossbelow and previousdetached ? color.new(color.green, 40) : na)
plot(ema100)