Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add ISeries together ie Open+High+Low+Close

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

    How to add ISeries together ie Open+High+Low+Close

    What is the best way to add ISeries objects together using addition to create a new ISeries object?

    I am trying to pass in OHLC/4 to the moving average indicators as the input source data. I see Weighted is HLCC/4, Typical is HLC/3, and Median is HL/2 but I don't see a PriceSeries for OHLC/4.

    This gives a compile error: MovAvgTrendValue = EMA((Open+High+Low+Close)/4.0,MovAvgTrendPeriod)[0];

    #2
    Hello zagier,

    Thank you for your post.

    You would need to create your own custom series where each value is the O+H+L+C / 4. Then you can pass that series into your indicator.

    For example,

    Code:
    private Series<double> myDoubleSeries;
    
    //in State.DataLoaded
    myDoubleSeries = new Series<double>(this, MaximumBarsLookBack.Infinite);
    
    //in OnBarUpdate()
    myDoubleSeries[0] = (Open[0] + High[0] + Close[0] + Low[0]) / 4;


    Please let us know if you have any further questions.

    Comment


      #3
      Thanks...this helped me too.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      87 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      132 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      118 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X