Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing parameter settings of an indicator

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

    Changing parameter settings of an indicator

    Hi together,

    is it possible to change the settings of an indicator, which is added in the initialize method, during runtime?
    I'd like to modify a setting of an indicator based on some market conditions.
    Let's say, if the momentum is above 0.1 I'd like to use an offset factor for calculating the SAR indicator which is plotted on the chart. The momentum indi is not visible.

    Thanks for comments and helping!

    #2
    Hello Cicondo,

    Thank you for your post.

    You can do this, but all the logic belongs in OnBarUpdate()

    The concept is setting your plots depending on conditional statements.

    Code:
     
    if (Momentum(20)[0] > .1)
        Plot0.Set(sarSettingsHere);
     
    else
        Plot0.Set(otherSarSettingsHere);
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    145 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    82 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    126 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    121 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Working...
    X