Page 1 of 1

could not find method for method reference 'is bullishEC' for zen (I'm struggling on the first mastery video) thanks

Posted: Thu Nov 09, 2023 8:34 pm
by royst88
//@version=5
indicator("rsi oscillator")

//import zen library
import ZenAndTheArtOfTrading/ZenLibrary/2 as zen


//get user input
lookback = input.int(title="lookback", defval=7)
rsilen = input.int(title="rsi leght", defval=7)
rsiob = input.float(title= "RSI overbought", defval=80.0)
rsios = input.float(title="rsi oversold", defval=20.0)


// get RSI value
rsi = ta.rsi(close,rsilen)
rsisell = rsi >rsiob
rsibuy = rsi <rsios

//detect candle patterns
bullEC = zen.isbullishEC()
bearEC = zen.isbearishEC()

// decect buy and sell signals
buysignal = bullEC and (rsibuy or rsibuy[1])
sellsignal = bearEC and (rsisell or rsisell[1])


// draw the data to the chart
plot(rsi, title = "rsi", color=rsibuy ? color.lime : rsisell ? color.red : color.black, linewidth=2)
plot(rsiob, title="rsi overbought", color=color.lime)
plot(rsios, title= "rsi oversold", color=color.lime)
bgcolor(buysignal ? color.lime : sellsignal ? color.red : na, title= "trade signal")


//trigger alerts
alertcondition(buysignal or sellsignal, title = "rsi signal", message= "rsi exhaustion setup for {{ticker}} rsi value = {{plot_0}}")
plot(na)

Re: could not find method for method reference 'is bullishEC' for zen (I'm struggling on the first mastery video) thanks

Posted: Mon Nov 13, 2023 4:07 am
by Steve Burman
Roy everything is case sensitive. You need to make sure you capitalise where it is needed. Usually Matt uses lowercase on the 1st part of a variable and Capital on the 1st letter of the subsequent parts. The fix to this is as follows:

bullEC = zen.isBullishEC()
bearEC = zen.isBearishEC()