Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Call Multiple TF's from an indicator

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

    Call Multiple TF's from an indicator

    Hi,

    I have made and indicator that simply either returns True or False.

    Now i am making another indicator that will call the original indicators output for 5 different Timeframes.

    I have read all the help forums but simply cant work out how to do it.

    I have added 5 timeframes in the original indicaor..... How do I call/assign them in the second indicator?

    I thought i may just be able to assign it like this

    double indicator = Indicator(parameters go here)[data series number goes here?];

    But no luck


    Thanks.



    This is the initialise function for the indicator that returns the bool value.


    protected override void Initialize()
    {
    //Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    Overlay = true;
    CalculateOnBarClose = false;

    Add(PeriodType.Minute, 5);
    Add(PeriodType.Minute, 15);
    Add(PeriodType.Minute, 30);
    Add(PeriodType.Minute, 60);
    Add(PeriodType.Minute, 180);
    Add(PeriodType.Day, 1);
    }

    #2
    Marty, you would need to direct the custom indicator to use your desired series in the bars array, so for example -

    double myIndicator = SMA(Closes[2][0], 20)[0];

    would mean you're calculating the SMA on the Close value of the 2nd added (so in total 3rd) series in your script.



    Arrays for Lows, Highs, Opens, Medians....are available as well depending on what price type you wish to work on.

    Comment


      #3
      Thanks.. Works now.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      82 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      43 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      56 views
      0 likes
      Last Post CarlTrading  
      Working...
      X