Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    156 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    90 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    138 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X