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

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.



    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 BarzTrading, Today, 07:25 AM
        2 responses
        24 views
        1 like
        Last Post BarzTrading  
        Started by devatechnologies, 04-14-2024, 02:58 PM
        3 responses
        20 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by tkaboris, Today, 08:01 AM
        0 responses
        4 views
        0 likes
        Last Post tkaboris  
        Started by EB Worx, 04-04-2023, 02:34 AM
        7 responses
        163 views
        0 likes
        Last Post VFI26
        by VFI26
         
        Started by Mizzouman1, Today, 07:35 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X