Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sma/ema Hlco/4

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

    Sma/ema Hlco/4

    Hi,

    is it possible to set the SMA/EMA indicators to (High+Low+Close+Open)/4?

    if not, does anyone have a custom indicator which does that?

    cheers

    #2
    Hi sub5mango,

    Thanks for your post.

    You would need to store the ( Open + High + Low + Close ) / 4 calculations in a DataSeries object and pass this in as input to the moving average indicator.

    Here is a reference sample demonstrating the use of a DataSeries object -

    http://www.ninjatrader-support.com/vb/showthread.php?t=7299

    Here is a reference to the section of our HelpGuide discussing a DataSeries object -

    http://www.ninjatrader-support.com/HelpGuideV6/DataSeriesObject.html

    The code snippet below is an approximation of what you seek:

    myDataSeries.Set(( Open + High + Low + Close ) / 4);
    SMA(myDataSeries, periodValue)

    Comment


      #3
      thanks, that worked a treat

      code:
      myDataSeries.Set(((Open[0]+High[0]+Low[0]+Close[0])/4));AvgR.Set(EMA(myDataSeries, Period)[0]);

      Comment


        #4
        out of curiosity, what would you use this compound indicator to demonstrate or track?

        also, can you post a recent ES or TF or YM picture of this indicator?

        thanks

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X