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

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;

    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)



        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.

            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 algospoke, Yesterday, 06:40 PM
                  2 responses
                  23 views
                  0 likes
                  Last Post algospoke  
                  Started by ghoul, Today, 06:02 PM
                  3 responses
                  14 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  45 views
                  0 likes
                  Last Post jeronymite  
                  Started by Barry Milan, Yesterday, 10:35 PM
                  7 responses
                  22 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  10 responses
                  181 views
                  0 likes
                  Last Post jeronymite  
                  Working...
                  X