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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    154 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    306 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    345 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X