• 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

EMA Plot with Different Colors

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

    EMA Plot with Different Colors

    Hi, I just wanted some advice about plotting a custom EMA.

    I am creating a plot of EMA (or any other built in MA) with the color of the plot based on the angle and I just wanted to know the best or most efficient way to plot it.

    Should I use Drawline() from Y value of bar[1] to Y value of Bar[0], or is there a method in the Plot class that can achieve the same thing, and may be better to use, or is there a better different way that I am not aware of?

    Thanks,
    will.

    #2
    Hello Will,

    Thank you for your post.

    For coloring the plots I would use PlotColors: http://www.ninjatrader.com/support/h...plotcolors.htm
    Code:
    if(Rising(EMA(period))
    PlotColors[0][0] = Color.Green;
    else
    PlotColors[0][0] = Color.Red;
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Hi, that works thanks.

      Can you tell me if I have 2 plots in my indicator is it possible to put the first plot in the default panel and a second plot in (say) Panel 1?

      Thanks.

      Comment


        #4
        Originally posted by dontpanic View Post
        Hi, that works thanks.

        Can you tell me if I have 2 plots in my indicator is it possible to put the first plot in the default panel and a second plot in (say) Panel 1?

        Thanks.
        No, you can't.

        But there are work arounds (make another indicator)

        http://www.ninjatrader.com/support/f...eparate+panels

        http://www.ninjatrader.com/support/f...eparate+panels

        Comment


          #5
          Hi,

          I see in one of those workarounds that you can still use the Draw() methods to draw into a different panel. I've searched the help and forum but can't find out how to do that, could you explain?

          Thanks.

          Comment


            #6
            Originally posted by dontpanic View Post
            Hi,

            I see in one of those workarounds that you can still use the Draw() methods to draw into a different panel. I've searched the help and forum but can't find out how to do that, could you explain?

            Thanks.
            http://www.ninjatrader.com/support/f...separate+panel

            Comment


              #7
              Hi,

              that example refers to a strategy, I think. I just have an indicator. Do I have to make a strategy, or is there a way to do it in my indicator?

              If I add the code Add(SMA(20)) to my indicator, it won't compile.

              Thanks

              Comment


                #8
                Originally posted by dontpanic View Post
                Hi,

                that example refers to a strategy, I think. I just have an indicator. Do I have to make a strategy, or is there a way to do it in my indicator?

                If I add the code Add(SMA(20)) to my indicator, it won't compile.

                Thanks
                Honestly, make your life easy on yourself for the time being.

                Use "Save As" the indicator as another name to make a copy, and use the 1st indicator as plot on panel, and the other indicator as plot on 2nd panel.

                NT8 might be different.

                Comment


                  #9
                  Ok, I will do that for now, thanks.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rouillard, Today, 03:34 PM
                  1 response
                  12 views
                  0 likes
                  Last Post NinjaTrader_Tyler  
                  Started by mquinteroj, Today, 02:41 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by JPPoulin, Today, 01:32 PM
                  4 responses
                  15 views
                  0 likes
                  Last Post JPPoulin  
                  Started by bltdavid, Today, 01:09 PM
                  1 response
                  10 views
                  0 likes
                  Last Post NinjaTrader_Kate  
                  Started by pstrusi, Today, 12:50 PM
                  2 responses
                  8 views
                  0 likes
                  Last Post pstrusi
                  by pstrusi
                   
                  Working...
                  X