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 adeelshahzad, Today, 03:54 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Working...
        X