I'm trying to make a custom script using the Supertrend indicator and could use some help from fellow traders/coders. I'm not fully familiar with Ninja Script yet, but have developed some basic coding logic working with Pine Script on Tradingview. I'm just trying to modify some parameters and compiling from existing scripts. Here's my trouble. I see several different versions of the Supertrend indicator, for example TSSupertrend, SupertrendM11 etc. There's one thing common in them is that there's some kind of baseline smoothing parameter, using a moving average/median.
My question is, is a moving average/median smoothing absolutely necessary for the Supertrend indicator on Ninja Script? In Pine Script, Supertrend uses only two parameters, 'Factor' and 'Period' and I always got good results using just that. With the moving average/median smoothing added, it changes by a margin. Is there a way to avoid the baseline smoothing? I understand that Ninjatrader can't help me with custom coding but if anyone can direct me regarding the dynamics of the baseline smoothing in relation with Ninja Script, it'd help me with finding a way to make it work.
Any help/guidance/suggestion will be greatly appreciated.
Thank you (:

Comment