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 Jonafare, 12-06-2012, 03:48 PM
        5 responses
        3,986 views
        0 likes
        Last Post rene69851  
        Started by Fitspressorest, Today, 01:38 PM
        0 responses
        2 views
        0 likes
        Last Post Fitspressorest  
        Started by Jonker, Today, 01:19 PM
        0 responses
        2 views
        0 likes
        Last Post Jonker
        by Jonker
         
        Started by futtrader, Today, 01:16 PM
        0 responses
        9 views
        0 likes
        Last Post futtrader  
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,792 views
        0 likes
        Last Post aligator  
        Working...
        X