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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    82 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    43 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    56 views
    0 likes
    Last Post CarlTrading  
    Working...
    X