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

Colorising the space between two RSI's.

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

    Colorising the space between two RSI's.

    Hi there,

    I've been trying to color the space between two separate RSI's and have been struggling to get it right.

    I've been using the 'Draw.Region()' code and after successfully compiling, the space in between the 2 RSI's is still transparent.

    Can anyone possibly show me a piece of code that would allow this to work using two RSI's?

    Also, just in case this helps.. for both RSI's I have set the 'Period' plot to transparent, the only visual plots from each RSI are the 'Smooth' plots.

    The ultimate goal is to create a colorised zone between the 1st RSI's Smooth and the 2nd RSI's Smooth.

    Any help will be much appreciated, thanks.

    #2
    Hello RoswellTrader,

    Can you post the code you tried? The color of the region is controlled by the color you pass to it so the plots being transparent wouldn't make a difference for the region.

    There is a sample in the help guide that colors the region between two plots, that is using the bollinger but you could change that to using the RSI to achieve the same type of result. That would essentially be the exact code you would need to color the region for the RSIs. You need to make sure the BarsAgo being used is between 0 and CurrentBar so it colors the whole series.

    JesseNinjaTrader Customer Service

    Comment


      #3

      Hi Jesse, I apologize for the late response.

      I will attach my code below in a text file.

      The code compiles successfully, but the space between RSI 1 + RSI 2 is still transparent.

      Thanks so much for your help.



      Attached Files

      Comment


        #4
        Hello RoswellTrader,

        The RSI does not produce price values so the object will be drawn out of view. To color the RSI you would need to do a few changes. Your indicator will need to run from a sub panel so you can display the RSI price range. To do that you need to set IsOverlay = false.



        You also need to set DrawOnPricePanel = false so the drawing object appears in the new panel.



        You also need to re plot the RSI values so your indicators scale has the right prices, without plotting the RSI values the scale won't be in the corect price range to see the region. You can add two plots and then assign them the 2 RSI values.

        After those changes you need to remove and re apply the script on the chart.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks so much Jesse! I'm still trying to figure this out, but slowly getting there. I will let you know if I run into any issues.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DJ888, Today, 10:57 PM
          0 responses
          5 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          158 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Today, 09:29 PM
          0 responses
          7 views
          0 likes
          Last Post Belfortbucks  
          Started by zstheorist, Today, 07:52 PM
          0 responses
          7 views
          0 likes
          Last Post zstheorist  
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          151 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Working...
          X