Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Want to add few things in Volume Indicator

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

    Want to add few things in Volume Indicator

    hey Guys want to plot Volume in Different color which is Greater than 150000.

    what changes should I do In Ninjatrader's Volume Indicator ??

    public class VOL : Indicator
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDe scriptionVOL;
    Name = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meVOL;
    BarsRequiredToPlot = 0;
    Calculate = Calculate.OnEachTick;
    DrawOnPricePanel = false;
    IsSuspendedWhileInactive = true;

    AddPlot(new Stroke(Brushes.DodgerBlue, 2), PlotStyle.Bar, NinjaTrader.Custom.Resource.VOLVolume);
    AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZe roLine);
    }
    else if (State == State.Historical)
    {
    if (Calculate == Calculate.OnPriceChange)
    {
    Draw.TextFixed(this, "NinjaScriptInfo", string.Format(NinjaTrader.Custom.Resource.NinjaScr iptOnPriceChangeError, Name), TextPosition.BottomRight);
    Log(string.Format(NinjaTrader.Custom.Resource.Ninj aScriptOnPriceChangeError, Name), LogLevel.Error);
    }
    }
    }

    protected override void OnBarUpdate()
    {
    Value[0] = Volume[0];
    }
    }

    #2
    Originally posted by svadukia View Post
    hey Guys want to plot Volume in Different color which is Greater than 150000.

    what changes should I do In Ninjatrader's Volume Indicator ??

    public class VOL : Indicator
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDe scriptionVOL;
    Name = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meVOL;
    BarsRequiredToPlot = 0;
    Calculate = Calculate.OnEachTick;
    DrawOnPricePanel = false;
    IsSuspendedWhileInactive = true;

    AddPlot(new Stroke(Brushes.DodgerBlue, 2), PlotStyle.Bar, NinjaTrader.Custom.Resource.VOLVolume);
    AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZe roLine);
    }
    else if (State == State.Historical)
    {
    if (Calculate == Calculate.OnPriceChange)
    {
    Draw.TextFixed(this, "NinjaScriptInfo", string.Format(NinjaTrader.Custom.Resource.NinjaScr iptOnPriceChangeError, Name), TextPosition.BottomRight);
    Log(string.Format(NinjaTrader.Custom.Resource.Ninj aScriptOnPriceChangeError, Name), LogLevel.Error);
    }
    }
    }

    protected override void OnBarUpdate()
    {
    Value[0] = Volume[0];
    }
    }
    I have Done that Part but How Can I Add Alert ???

    Comment


      #3
      Hello svadukia,

      You can change the plot colors with the PlotBrushes collection.

      For example:

      if (/* conditions here *)
      {
      PlotBrushes[0] = Brushes.Green;
      }

      Below is a publicly available link to the help guide on PlotBrushes.



      The same action block of that condition can also trigger an alert.
      if (/* conditions here *)
      {
      PlotBrushes[0] = Brushes.Green;
      Alert("myAlert", Priority.Low, "My alert message here", @"", 1, Brushes.Black, Brushes.White);
      }

      Below is a publicly available link to help guide on Alert.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_ChelseaB View Post
        Hello svadukia,

        You can change the plot colors with the PlotBrushes collection.

        For example:

        if (/* conditions here *)
        {
        PlotBrushes[0] = Brushes.Green;
        }

        Below is a publicly available link to the help guide on PlotBrushes.



        The same action block of that condition can also trigger an alert.
        if (/* conditions here *)
        {
        PlotBrushes[0] = Brushes.Green;
        Alert("myAlert", Priority.Low, "My alert message here", @"", 1, Brushes.Black, Brushes.White);
        }

        Below is a publicly available link to help guide on Alert.
        https://ninjatrader.com/support/help...n-us/alert.htm
        Got it Thanks.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 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
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X