Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume indicador

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

    Volume indicador

    Hi. sorry for my English
    I have an indicator that marks me if a bar has more volume than the previous one
    I want that if the volume is greater than in the previous bar but the difference is less to for example 500 contracts the indicator does not warn.
    how can I do it? Thank you

    #2
    Hello julifro, and thank you for your question.

    In order to set a maximum difference, we will need a parameter into your strategy like this :

    Code:
    [FONT=Courier New]
            #region Properties
            [NinjaScriptProperty]
            [Range(1, int.MaxValue)]
            [Display(Name="MaxVolWarnThreshold", Order=1, GroupName="Parameters")]
            public int MaxVolWarnThreshold
            { get; set; }
            #endregion[/FONT]
    Once we have such a parameter, we can use it like this.

    Code:
    [FONT=Courier New]
            protected override void OnBarUpdate()
            {
                if (VOL()[1] < VOL()[0] && VOL()[0] < MaxVolWarnThreshold)
                {
                    Alert("MyAlertID", Priority.Low, "Alert : Volume higher but below threshold", "C:\\Program Files (x86)\\NinjaTrader 8\\sounds\\Alert1.wav", 10 /* rearm seconds */, Brushes.ForestGreen /*background*/, Brushes.Aqua /*foreground*/);
                }
            }[/FONT]
    I am attaching an indicator with this code. Please let us know if there are any other ways we can help.
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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