Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume High/Low.

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

    Volume High/Low.

    Hey Everyone,

    Has anyone developed an indicator much like MAX and MIN that applies to volume?

    #2
    Hi Drakmyre, I'm not aware of indicator like this, but you could directly pass the Volume into the MIN / MAX methods to create this.

    Comment


      #3
      Hey Bertrand,

      Would I have to edit the code so it's based on Volume and not Price?

      Comment


        #4
        That sounds correct Drakmyre!

        Comment


          #5
          Hey Bertrand,

          How would I go about editing the code? It's a system indicator so I can't save it. I tried editing it but I don't know where to insert the volume input in the code after I copy and paste it to a new indicator.

          Comment


            #6
            Hi, which indicator are looking to edit? Just right click in the system one and save the code under a new name for modification...you can take a look at those volume based files from our sharing for coding ideas and workarounds - http://www.ninjatrader-support2.com/...=volume&desc=1

            Comment


              #7
              Hey Bertrand,

              Just the MAX and MIN. I want to be able to apply them to volume like I do with price.

              Comment


                #8
                Hello,

                You can do this, but it will take custom programming. Give it a try and if you get stuck ask us questions.
                DenNinjaTrader Customer Service

                Comment


                  #9
                  Hey Killer Bs,

                  Here's the code but I don't know where to change the inputs so it read volume instead of price.

                  //

                  #region Using declarations
                  using System;
                  using System.Diagnostics;
                  using System.Drawing;
                  using System.Drawing.Drawing2D;
                  using System.ComponentModel;
                  using System.Xml.Serialization;
                  using NinjaTrader.Data;
                  using NinjaTrader.Gui.Chart;
                  #endregion

                  // This namespace holds all indicators and is required. Do not change it.
                  namespace NinjaTrader.Indicator
                  {
                  /// <summary>
                  /// The Maximum shows the maximum of the last n bars.
                  /// </summary>
                  [Description("The Maximum shows the maximum of the last n bars.")]
                  public class MAX : Indicator
                  {
                  #region Variables
                  private int period = 14;
                  #endregion

                  /// <summary>
                  /// This method is used to configure the indicator and is called once before any bar data is loaded.
                  /// </summary>
                  protected override void Initialize()
                  {
                  Add(new Plot(Color.Green, "MAX"));

                  Overlay = true;
                  PriceTypeSupported = true;
                  }

                  /// <summary>
                  /// Called on each bar update event (incoming tick)
                  /// </summary>
                  protected override void OnBarUpdate()
                  {
                  double val = double.MinValue;
                  for (int barsBack = Math.Min(CurrentBar, Period - 1); barsBack >= 0; barsBack--)
                  val = Math.Max(val, Input[barsBack]);
                  Value.Set(val);
                  }

                  #region Properties
                  /// <summary>
                  /// </summary>
                  [Description("Numbers of bars used for calculations")]
                  [Category("Parameters")]
                  public int Period
                  {
                  get { return period; }
                  set { period = Math.Max(1, value); }
                  }
                  #endregion
                  }
                  }

                  #region NinjaScript generated code. Neither change nor remove.
                  // This namespace holds all indicators and is required. Do not change it.
                  namespace NinjaTrader.Indicator
                  {
                  public partial class Indicator : IndicatorBase
                  {
                  private MAX[] cacheMAX = null;
                  private static MAX checkMAX = new MAX();

                  /// <summary>
                  /// The Maximum shows the maximum of the last n bars.
                  /// </summary>
                  /// <returns></returns>
                  public MAX MAX(int period)
                  {
                  return MAX(Input, period);
                  }

                  /// <summary>
                  /// The Maximum shows the maximum of the last n bars.
                  /// </summary>
                  /// <returns></returns>
                  public MAX MAX(Data.IDataSeries input, int period)
                  {
                  checkMAX.Period = period;
                  period = checkMAX.Period;

                  if (cacheMAX != null)
                  for (int idx = 0; idx < cacheMAX.Length; idx++)
                  if (cacheMAX[idx].Period == period && cacheMAX[idx].EqualsInput(input))
                  return cacheMAX[idx];

                  MAX indicator = new MAX();
                  indicator.BarsRequired = BarsRequired;
                  indicator.CalculateOnBarClose = CalculateOnBarClose;
                  indicator.Input = input;
                  indicator.Period = period;
                  indicator.SetUp();

                  MAX[] tmp = new MAX[cacheMAX == null ? 1 : cacheMAX.Length + 1];
                  if (cacheMAX != null)
                  cacheMAX.CopyTo(tmp, 0);
                  tmp[tmp.Length - 1] = indicator;
                  cacheMAX = tmp;
                  Indicators.Add(indicator);

                  return indicator;
                  }
                  }
                  }

                  // This namespace holds all market analyzer column definitions and is required. Do not change it.
                  namespace NinjaTrader.MarketAnalyzer
                  {
                  public partial class Column : ColumnBase
                  {
                  /// <summary>
                  /// The Maximum shows the maximum of the last n bars.
                  /// </summary>
                  /// <returns></returns>
                  [Gui.Design.WizardCondition("Indicator")]
                  public Indicator.MAX MAX(int period)
                  {
                  return _indicator.MAX(Input, period);
                  }

                  /// <summary>
                  /// The Maximum shows the maximum of the last n bars.
                  /// </summary>
                  /// <returns></returns>
                  public Indicator.MAX MAX(Data.IDataSeries input, int period)
                  {
                  return _indicator.MAX(input, period);
                  }
                  }
                  }

                  // This namespace holds all strategies and is required. Do not change it.
                  namespace NinjaTrader.Strategy
                  {
                  public partial class Strategy : StrategyBase
                  {
                  /// <summary>
                  /// The Maximum shows the maximum of the last n bars.
                  /// </summary>
                  /// <returns></returns>
                  [Gui.Design.WizardCondition("Indicator")]
                  public Indicator.MAX MAX(int period)
                  {
                  return _indicator.MAX(Input, period);
                  }

                  /// <summary>
                  /// The Maximum shows the maximum of the last n bars.
                  /// </summary>
                  /// <returns></returns>
                  public Indicator.MAX MAX(Data.IDataSeries input, int period)
                  {
                  if (InInitialize && input == null)
                  throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

                  return _indicator.MAX(input, period);
                  }
                  }
                  }
                  #endregion

                  Do I tie the inputs to volume? How would I go about doing that?

                  Comment

                  Latest Posts

                  Collapse

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