Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Instrument Indicator

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

    Multi Instrument Indicator

    I want to call the High and Low values of indicator XYZ of instrument ABC.

    Protected override void Initialize()
    {
    Add("ABC",PeriodType.Minute,1);
    }

    Protected override void OnBarUpdate()
    {
    double XYZHigh = XYZ().TheHigh[0];
    double XYZLow = XYZ().TheLow[0];
    }

    How do I reference ABC in the above OnBarUpdate for this to work?
    Thanks in advance

    #2
    Originally posted by 2Look4me View Post
    I want to call the High and Low values of indicator XYZ of instrument ABC.

    Protected override void Initialize()
    {
    Add("ABC",PeriodType.Minute,1);
    }

    Protected override void OnBarUpdate()
    {
    double XYZHigh = XYZ().TheHigh[0];
    double XYZLow = XYZ().TheLow[0];
    }

    How do I reference ABC in the above OnBarUpdate for this to work?
    Thanks in advance
    I believe this is what your looking for


    I just realised it was the indicator val you need not the high....

    See here.



    if you call your indicator as per normal but only in the correct BarsInProgress index then it will work.

    I dont know if you can call an indicator from the added timeframe directly without being in the correct barsinprogress but i would be interested to hear if there is a way.

    Here is an example

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    Add("$AUDUSD", PeriodType.Minute, 5);
    Add("$EURUSD", PeriodType.Minute, 5);
    }


    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 1)Print ("Atr for AUDUSD 5 min = "+ATR(14)[0]);
    if (BarsInProgress == 2)Print ("Atr for EURUSD 5 min = "+ATR(14)[0]);

    }
    Last edited by marty087; 10-13-2015, 05:14 AM.

    Comment


      #3
      Hello 2Look4me,

      Thank you for your post.

      To reference the added bar series add BarsArray[1] to the indicator. For example:
      Code:
      XYZ(BarsArray[1]).TheHigh[0]

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      579 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 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
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X