Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compute indicator values within a strategy on midpoints rather than bar closes

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

    Compute indicator values within a strategy on midpoints rather than bar closes

    Hello,

    I did a quick search on forums and couldn't find a solution, so apologies if this has been answered before, but I was wondering if there was an easy way to compute indicator values on something other than the closing bar prices.

    Specifically would like to pass in something like: (open + close) / 2 as my series, and compute RSI, or MACD values based on those values.

    Is there a relatively painless way to do that in code (modification to: BarsArray[0].RSI(14,1)[0]) rather than importing an entire unique data set?

    Thanks!


    #2
    Hello slocumtrader,

    Thanks for your post.

    By default, most indicators will use the Close price type series.

    There are other price type series that you can use, here is the list:

    Open
    High
    Low
    Close (default)
    Typical = (High + Low + Close) / 3.
    Median = (High + Low) / 2.
    Weighted = (High + Low + Close + Close) / 4.

    So for your RSI or MACD example, you would choose the "Typical" price type. This is done when you select the indicator in the Indicator panel. Locate the "input series" row and left-click on the current selection. A window titled "Input series" appears, on the left side click the "drop-down" arrow in the "price type" field and choose Typical.



    Comment


      #3
      Hi Paul,

      Thanks for the fast response. Running through the strategy wizard I did follow the steps you outlined and generated the code:

      RSIindicator = RSI(Typical, 14, 1);

      For (open+high+low)/3 RSI indicator values.

      Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      132 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X