Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 kujista, Today, 06:23 AM
        5 responses
        15 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by f.saeidi, Today, 10:19 AM
        0 responses
        2 views
        0 likes
        Last Post f.saeidi  
        Started by traderqz, Yesterday, 09:06 AM
        2 responses
        16 views
        0 likes
        Last Post traderqz  
        Started by traderqz, Today, 12:06 AM
        3 responses
        6 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by RideMe, 04-07-2024, 04:54 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X