Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trend Noise Balance Indicator(B-Indicator)

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

    Trend Noise Balance Indicator(B-Indicator)

    If there anyway anyone could put this indicator together for me on Ninjatrader?

    I use this one often on think or swim, and it has several adjustable parameters. fast length, slow length, trend length, noise type, noise length, and correction factor. Anyway to program this one for Ninjatrader?

    Source from ToS Platform:


    Code:
    #
    # TD Ameritrade IP Company, Inc. (c) 2009-2015
    #
    
    declare lower;
    
    input fastLength = 7;
    input slowLength = 15;
    input trendLength = 4;
    input noiseType = {default linear, squared};
    input noiseLength = 250;
    input correctionFactor = 2;
    
    assert(trendLength > 0, "'trend length' must be positive: " + trendLength);
    assert(correctionFactor > 0, "'correction factor' must be positive: " + correctionFactor);
    
    def smf = 2 / (1 + trendLength);
    
    def reversal = TrendPeriods(fastLength, slowLength);
    
    def cpc = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else cpc[1] + close - close[1];
    
    def trend = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else trend[1] * (1 - smf) + cpc * smf;
    
    def noise;
    def diff = AbsValue(cpc - trend);
    switch(noiseType) {
    case linear:
        noise = correctionFactor * Average(diff, noiseLength);
    case squared:
        noise = correctionFactor * Sqrt(Average(diff*diff, noiseLength));
    }
    
    def denom = AbsValue(trend) + AbsValue(noise);
    plot TNB = if denom == 0 then 0 else 100 * AbsValue(trend) / denom;
    plot HalfLine = 50;
    
    TNB.SetDefaultColor(GetColor(9));
    HalfLine.SetDefaultColor(GetColor(5));

    #2
    Good morning,

    Thank you for your interest in NinjaTrader and NinjaScript.

    This would certainly be possible to create in NinjaTrader using NinjaScript, I should note that forum posts such as these may or may not received community help for converting over to NS, depending on its complexity, To ensure your item is created you can speak with a consultant.

    I would like to provide some information on the NinjaTrader Ecosystem NinjaScript Consultants in the case there are no users who would like to create this item for you.

    You can find more information on the NTE consultant services at the following publicly available link:

    Search trading indicators, apps and services to personalize your NinjaTrader software. Explore custom trading indicators, automated strategies, free trading apps & more!



    If you would rather try to create this yourself please let me know and we can get you connected with a NinjaScript service member to assist in your learning NinjaScript.
    DanielleNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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