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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X