Help with PPO
-
Hello,
I am new to the backtrader community and need help with a specific indicator that I am trying to convert. Indicator is used for finding market tops and bottom based on the calculations.
I am struggling to replicate those calculations in backtrader. Below is the specific function that I am not sure how to convert. As you can see in the function it used L0[1], I am not sure how to get this value. I was thinking of putting this value in an array but how would I reference it. or I should create an array the first time it will be zero and for the next candle it will have an value at index 1 and keep track of the candle number and use always candle-1. just thinking out loud
lag(g, p) =>
L0 = (1 - g)p+gnz(L0[1])
L1 = -gL0+nz(L0[1])+gnz(L1[1])
L2 = -gL1+nz(L1[1])+gnz(L2[1])
L3 = -gL2+nz(L2[1])+gnz(L3[1])
f = (L0 + 2L1 + 2L2 + L3)/6
fLink to the Indicator
https://www.tradingview.com/script/ngr0qRmw-CM-Laguerre-PPO-PercentileRank-Mkt-Tops-Bottoms/ -
@amit https://community.backtrader.com/post/15929
and please keep one post for one issue.