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

Creating Indicator based on other Indicators

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

    Creating Indicator based on other Indicators

    Hello,
    Can anyone kindly advise me as to how to Create an Indicator based on other Indicators.

    Basically what i'm looking for is how to create an indicator and then plot that indicator on the Price Chart itself, for example an indicator that plots a downarrow above the bar where CCI is more than 100 and an up arrow below the bar where CCI is ess than 20.

    Also, how to create an indicator like the one mentioned above but where multiple indicators could be added and used in a similar fashion and the indicator properties could be altered like days

    I would really appreciate anyhelp in this regard.

    #2
    Hello sharmanup,
    Welcome to the forum and I am happy to assist you.

    You can use the bleow code snippet to do something when CCI crosses above 100.
    Code:
    if (CCI(14)[0] > 100)
    {
      //do something
    }
    You have to add multiple Plots and assign the necessary values to it to add multiple indicators from the same indicator.

    For example if you want to add the Stochastics and the RSI indicator from the same code then please create 2 Plots and assign the values to it as shown below.

    Code:
    //In Initialze section of the code
    Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "Plot0"));
    Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Plot1"));
    
    In OnBarUpdate section of the code
    Plot0.Set(RSI(14)[0]);
    Plot1.Set(Stochastics(7, 14, 3)[0]);
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by selu72, Today, 02:01 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by WHICKED, Today, 02:02 PM
    2 responses
    10 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by f.saeidi, Today, 12:14 PM
    8 responses
    21 views
    0 likes
    Last Post f.saeidi  
    Started by Mikey_, 03-23-2024, 05:59 PM
    3 responses
    51 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by Russ Moreland, Today, 12:54 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X