Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 nightstalker, Today, 01:32 PM
    0 responses
    1 view
    0 likes
    Last Post nightstalker  
    Started by NTCalmPersistence15, Today, 10:03 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by DawnTreader, 05-08-2024, 05:58 PM
    13 responses
    45 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by jpeep, 08-16-2020, 08:31 AM
    15 responses
    497 views
    0 likes
    Last Post notenufftime  
    Started by ldanenberg, Yesterday, 03:19 PM
    2 responses
    13 views
    0 likes
    Last Post ldanenberg  
    Working...
    X