-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Customized indicator
#1029
-
Hi group,
I am new to coding, I am trading SPX, and want to create an indicator using VIX and VIX3M, which means the trading signal is not deprived from SPX itself, it's from VIX index. I came up with the code below, but seems not woking, can someone please take a look and shed some lights here?
def indicator():
vratio = ta.hma(dfVIX.Close/dfVIX3M.Close, 3)
return
class SignalStrategy(Strategy):
def init(self):
self.mysignal = self.I(indicator)
def next(self):
if not self.position and crossover(self.mysignal,1):
self.buy()
elif crossover(1,self.mysignal):
self.position.close()
Don't have a clue what's wrong!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
Is "ta" pandas-ta?
vratio = ta.hma(dfVIX.Close/dfVIX3M.Close, 3)
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
Would like a follow-up to this for TA-Lib and Pandas-TA
Beta Was this translation helpful? Give feedback.
All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment