I keep getting an error about argmax and empty series when using a custom indicator function #433
Precisionguided
started this conversation in
General
Replies: 1 comment 9 replies
-
It's way easier to talk about code with some actual sample code. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thanks for the great tool you've provided! I've been able to backtest strategies based on the talib indicators, but recently, I've been trying to convert one of my more complex tradingview strategies into backtesting.py but I'm having an issue with uncertainty about how data is passed to the functions. Pine script evaluates everything one candle at a time, but when I wrap an indicator it seems like it evaluates everything at once, which doesn't allow me to reference x[-1], x[-2] to perform operations on them on a rolling basis. I've tried to figure it out by looking at backtesting.Strategy but I'm still having a bit of difficulty figuring it out and I've tried using .rolling but it won't let me perform operations on variables that use rolling.. I was wondering if you could provide some direction.
Am I supposed to take a for loop and process it then output everything in an array, rather than doing everything as a stream?
Beta Was this translation helpful? Give feedback.
All reactions