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 wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        26 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, Yesterday, 09:53 PM
        2 responses
        49 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        192 views
        0 likes
        Last Post Hasadafa  
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,234 views
        0 likes
        Last Post xiinteractive  
        Working...
        X