Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Channel indic with different distance to mid

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

    Channel indic with different distance to mid

    Hello

    Does anybody know of a "channel indic" (like a bollinger band, CCI, keltner etc) in NT8 that allows you to set an asymmetrical channel? So, for example:

    UPPER band = center + 1 std dev
    LOWER band = center - 0.5 std dev

    Could be expressed in % or whatever, but the thing I'm looking for is the asymmetry.

    Many thanks in advance.

    #2
    Hello StockTrader88,
    Thanks for your post and welcome to the NinjaTrader forum.

    I am unaware of a specific indicator that can do this, but if you wanted to code the indicator yourself you could use something similar to the following snippet to plot the formulas you provided.

    Code:
    public class SMAChannels: Indicator
    {
    	private double PrimaryValue;
    	private double UpperBand;
    	private double LowerBand;
    	protected override void OnStateChange()
    	{
    		if (State == State.SetDefaults)
    		{
    			AddPlot(Brushes.Yellow, "Upper");
    			AddPlot(Brushes.Red, "Primary");
    			AddPlot(Brushes.Blue, "Lower");
    		}
    	}
    	protected override void OnBarUpdate()
    	{
    		Values[0][0] = SMA(14)[0] + StdDev(14)[0];//Upper Band
    		Values[1][0] = SMA(14)[0];//Middle Band
    		Values[2][0] = SMA(14)[0] - (0.5)*StdDev(14)[0];//Lower Band 
    	}
    }
    Help Guide- Values

    Help Guide- StdDev()

    Help Guide- AddPlot()
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot for your helpful reply!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X