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 Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,788 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,293 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        13 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        63 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X