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

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:

      The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies


      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)


            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 traderqz, Today, 12:06 AM
            10 responses
            18 views
            0 likes
            Last Post traderqz  
            Started by algospoke, 04-17-2024, 06:40 PM
            5 responses
            46 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by arvidvanstaey, Today, 02:19 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Started by mmckinnm, Today, 01:34 PM
            3 responses
            5 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by f.saeidi, Today, 01:32 PM
            2 responses
            9 views
            0 likes
            Last Post f.saeidi  
            Working...
            X