I am trying to write my own KDJ indicator, I basically copy the code from Tradingview: https://www.tradingview.com/script/h51ZIRlX-KDJ-Indicator-iamaltcoin/ and try to make it work on QuantScript.
This is what I have so far:
However, when I compare the J value from my Debugger to the one on TradingView, my J value is showing the previous bar’s J value on TradingView. I am guessing it is something to do with the function I have but I can’t figure it out.
Any help is appreciated. Thank you!