royst88
Pine Script Scholar
Pine Script Scholar
Posts: 4
Joined: November 6th, 2023
Contact: TradingView Profile

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

//@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)

Steve Burman
Moderator
Moderator
Posts: 109
Joined: January 13th, 2023

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

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()
Last edited by Steve Burman on Mon Nov 13, 2023 4:10 am, edited 1 time in total.

Return to “Pine Script Q&A”