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 CortexZenUSA, Today, 12:53 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by CortexZenUSA, Today, 12:46 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by usazencortex, Today, 12:43 AM
        0 responses
        5 views
        0 likes
        Last Post usazencortex  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,265 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X