• 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 Guru73, Today, 02:47 AM
        1 response
        3 views
        0 likes
        Last Post Guru73
        by Guru73
         
        Started by pjsmith, Today, 02:44 AM
        0 responses
        1 view
        0 likes
        Last Post pjsmith
        by pjsmith
         
        Started by dalebru, Today, 01:51 AM
        1 response
        4 views
        0 likes
        Last Post bltdavid  
        Started by Austiner87, Yesterday, 09:33 PM
        0 responses
        9 views
        0 likes
        Last Post Austiner87  
        Started by HiddenPhilosopher, Yesterday, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post HiddenPhilosopher  
        Working...
        X