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 trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        22 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Started by guillembm, Yesterday, 11:25 AM
        2 responses
        9 views
        0 likes
        Last Post guillembm  
        Started by junkone, 04-21-2024, 07:17 AM
        9 responses
        68 views
        0 likes
        Last Post jeronymite  
        Started by mgco4you, Yesterday, 09:46 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X