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 NullPointStrategies, Today, 05:17 AM
      0 responses
      51 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      127 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X