Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Indicator Lines in a Script

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

    Change Indicator Lines in a Script

    Is it possible to change the value of an indicator level line from a strategy after the indicator is added to the strategy?

    Specifically I have the RSI indicator in a strategy and want to change the Upper and Lower lines from the default 70 and 30 to some other value based on optimization. This would be for plotting purposes to see what values the strategy is using for Upper and Lower.

    I cannot find any way to access a RSI.Upper(Uval) or RSI.Lower(Lval) methods, do they exist?

    #2
    Hello,

    Yes this is possible.

    Here is an example of modifying many different properties of an added indicator via a strategy

    Code:
    Add(RSI(RSIPeriod, 3));
    			RSI(RSIPeriod,3).Lines[0].Value = RSILower;
    			RSI(RSIPeriod,3).Lines[1].Value = RSIUpper;
    			RSI(RSIPeriod,3).Lines[0].Pen.Color = Color.Black;
    			RSI(RSIPeriod,3).Lines[0].Pen.Width = 2;
    			RSI(RSIPeriod,3).Lines[1].Pen.Color = Color.Black;
    			RSI(RSIPeriod,3).Lines[1].Pen.Width = 2;
    			RSI(RSIPeriod,3).Plots[1].Pen.Color = Color.Transparent;
    			RSI(RSIPeriod,3).Plots[0].Pen.Color = Color.Blue;
    			RSI(RSIPeriod,3).Plots[0].Pen.Width = 2;
    Let me know if I can further assist.
    LanceNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    569 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X