Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Baseline for Supertrend Indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Baseline for Supertrend Indicator

    Hi,

    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 (:

    #2
    Hello d3b4s1s,

    Thanks for your post.

    The reason why the Smooth property is included in the indicator is subjective.

    You could consider setting the Smooth property to 1 for the SuperTrend indicator you are using, such as TSSuperTrend. Setting the Smooth property to 1 would remove the smoothing that is being applied to the indicator.

    For example, you could apply the TSSuperTrend indicator on the chart using the Moving Avg.Type of SMA and a Smooth property of 1.

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    650 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    577 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X