Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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)
    BertrandNinjaTrader Customer Service

    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 bmartz, Today, 09:30 AM
        2 responses
        11 views
        0 likes
        Last Post bltdavid  
        Started by f.saeidi, Today, 11:02 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by geotrades1, Today, 10:02 AM
        4 responses
        12 views
        0 likes
        Last Post geotrades1  
        Started by rajendrasubedi2023, Today, 09:50 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by lorem, Today, 09:18 AM
        2 responses
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X