• 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

Color Fill the Distance Between Two Plots

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

    Color Fill the Distance Between Two Plots

    Hello, Is it possible to Fill the Color Area Between Two Plots.

    For Instance if you have diff= Donchian.Upper[1] - Donchian.Lower[1]; how do I "write something" that will Fill the Entire Color area which is 'diff'.

    #2
    Hello,
    Thank you for your post.
    You could color in the difference of two plots by using DrawRegion(). Please see the following link on DrawRegion() http://ninjatrader.com/support/helpG...drawregion.htm

    There is an example of using DrawRegion to color between two plots on the Forum. This indicator is the SMARegions and colors in the differences of two SMAs. You can download this indicator from the following link, http://ninjatrader.com/support/forum...tid=4&lpage=9]

    Please let us know if we can be of any other assistance.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by ginx10k View Post
      Hello, Is it possible to Fill the Color Area Between Two Plots.

      For Instance if you have diff= Donchian.Upper[1] - Donchian.Lower[1]; how do I "write something" that will Fill the Entire Color area which is 'diff'.
      I have uploaded the Donchian Channel here:

      https://futures.io/download/ninjatra...load.html?view

      If you cannot download it from www.futures.io, please send me a private message with your e-mail and I will send it to you.

      The Donchian Channel has the area between the bands filled. The indicator comes open source. You can easily study how it is done. Basically there are two ways of doing it

      -> either use DrawRegion(), which is a NinjaScript command
      -> alternatively code a custom plot which would be more accurate and faster
      Attached Files

      Comment


        #4
        Thanks Man. Much Appreciated

        Comment


          #5
          Hello,

          I´m trying to draw a region from Donchian Upper to a certain distance in Ticks below the upper, but can´t get it working. From the forum and the samples I can draw regions between MA, DonchianUpper and lower.... but not from and indicator to a distance in ticks.

          Thank you
          Tony

          Comment


            #6
            Hello,

            This could be accomplished using the overload set:

            Code:
            DrawRegion(string tag, int startBarsAgo, int endBarsAgo, IDataSeries series, double y, Color outlineColor, Color areaColor, int areaOpacity)
            http://ninjatrader.com/support/helpG...drawregion.htm

            You can supply the Indicators plot as the IDataSeries, and the a calculated value as the double value.

            An example would be:

            Code:
            protected override void OnBarUpdate()
            {	
            	if(CurrentBar < 1) return;
            	DrawRegion("Region" + CurrentBar, 0, 1, DonchianChannel(12).Upper, DonchianChannel(12).Upper[0] - 2 * TickSize, Color.Red, Color.Red, 100);
            }
            This would draw a region from the Upper line to two ticks below the Upper line.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Parmenides48, 04-09-2019, 03:32 AM
            8 responses
            43 views
            0 likes
            Last Post brucerobinson  
            Started by NinjaCustomer, Today, 01:48 AM
            0 responses
            2 views
            0 likes
            Last Post NinjaCustomer  
            Started by aligator, Yesterday, 10:11 PM
            0 responses
            2 views
            0 likes
            Last Post aligator  
            Started by psquare, Yesterday, 03:11 PM
            4 responses
            20 views
            0 likes
            Last Post psquare
            by psquare
             
            Started by ballboy11, Yesterday, 03:20 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X