• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

is there a way to plot ema calculated from high and low in one indicator?

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

    is there a way to plot ema calculated from high and low in one indicator?

    Hi,

    I'm trying to build an indicator that allows me to plot the ema calculated from close, and also from high and low. So, 3 lines in total, basically an ema channel.

    I don't have much programming experience. anyone can help how to do this? thanks

    #2
    Originally posted by ESHunter View Post
    Hi,

    I'm trying to build an indicator that allows me to plot the ema calculated from close, and also from high and low. So, 3 lines in total, basically an ema channel.

    I don't have much programming experience. anyone can help how to do this? thanks
    Yes! of course there is a way.

    http://ninjatrader.com/support/forum...ht=ema+channel

    This should be easy enough to modify....

    Comment


      #3
      It looks like the link would plot the channel upper/lower bands based on deviation, not on previous period highs and lows, correct? Is there a way to do it from highs and lows, or do you just have to create three moving averages?

      Comment


        #4
        Hello,
        You could have the plots in the indicator plot off of the Close, High, and Low values.
        For example:
        Code:
        protected override void Initialize()
        {
            Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "EmaLow"));
            Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "EmaHi"));
            Add(new Plot(Color.FromKnownColor(KnownColor.DarkViolet), PlotStyle.Line, "EmaClose"));
            Overlay				= true;
        }
        
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            // Use this method for calculating your indicator values. Assign a value to each
            // plot below by replacing 'Close[0]' with your own formula.
            EmaLow.Set(EMA(Low, 20)[0]);
            EmaHi.Set(EMA(High, 20)[0]);
            EmaClose.Set(EMA(Close, 20)[0]);
        }
        That would plot the EMA Channel that you are referring to. It would be similar to adding three moving averages.
        Cody B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by yeshujbp, Today, 08:10 PM
        0 responses
        1 view
        0 likes
        Last Post yeshujbp  
        Started by backtester831, Today, 06:54 PM
        0 responses
        1 view
        0 likes
        Last Post backtester831  
        Started by frayrengytrader, Today, 06:03 PM
        0 responses
        3 views
        0 likes
        Last Post frayrengytrader  
        Started by JustAFish, Today, 05:29 PM
        0 responses
        5 views
        0 likes
        Last Post JustAFish  
        Started by TraderCAD, Today, 04:27 PM
        1 response
        8 views
        0 likes
        Last Post TraderCAD  
        Working...
        X