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

RSI indicator DrawRegion?

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

    RSI indicator DrawRegion?

    Hi

    I don't know how to code this very simple thing. Can anyone help me? A'd appreciate it

    I need the NT original RSI (Wilder's RSI with a smooth) with 4 coloured horisontal region. The regions: 17-34, 38-49, 53-62, 66-83.

    I'd like to use it in ninja8.

    Thank you in anticipation.

    Mark
    Attached Files

    #2
    There is a problem with 67 and 83 but I don't know how to fix it

    Draw.Region(this,"tag1",255,255,67,83,Brushes.Blac k, 50);

    Comment


      #3
      Hello kt5ssm, and thank you for your question.

      I am attaching some indicator source code which I believe may meet your needs for educational purposes. Please study this code. If it does not quite meet your needs, please provide a brief explanation of your goals, and an attempt at modifying this code, and we will be happy to assist further
      Attached Files
      Jessica P.NinjaTrader Customer Service

      Comment


        #4
        As I see it is in NT7 language. Can you write it in NT8 language?

        Comment


          #5
          I would be happy to. I have attached the desired source to this reply.

          To go over this reply in detail, in both NT7 and NT8, this involved just 2 steps.

          • Create 4 plots
            • in the Initialize section in NT7
            • in the OnStateChange when State == State.SetDefaults section in NT8
          • In OnBarUpdate, set each plot to the current RSI value

          This code created our 4 plots in NT8,


          Code:
          [FONT=Courier New]                AddPlot(Brushes.DarkCyan, "Plot0");
                          AddPlot(Brushes.Magenta, "Plot1");
                          AddPlot(Brushes.Yellow, "Plot2");
                          AddPlot(Brushes.DarkGray, "Plot3");[/FONT]

          And this code set their values,


          Code:
          [FONT=Courier New]            Values[0][0] = (RSI(17, 34)[0]);
                      Values[1][0] = (RSI(38, 49)[0]);
                      Values[2][0] = (RSI(53, 62)[0]);
                      Values[3][0] = (RSI(66, 83)[0]);[/FONT]

          Please let us know if there are any other ways we can help.
          Attached Files
          Jessica P.NinjaTrader Customer Service

          Comment


            #6
            Dear Jessica,

            Thanks, but this code draw 2 "another rsi" in the indicator panel. Or what did I wrong?
            Attached Files

            Comment


              #7
              Hello kt5ssm,

              So I can understand better how we can improve your code, can you describe briefly how it is not meeting expectations?
              Jessica P.NinjaTrader Customer Service

              Comment


                #8
                I need this 2 blue and 2 grey "line" as you see in the attachment. The default Rsi and Its smooth is ok.
                Attached Files

                Comment


                  #9
                  Thank you for clarifying further.

                  The attached example code will show you how to use the Draw.RegionHighlightY method to achieve your desired results.

                  Your code was likely fine, you likely just needed to set DrawOnPricePanel to false.

                  Please let us know if there are any other ways we can help.
                  Attached Files
                  Jessica P.NinjaTrader Customer Service

                  Comment


                    #10
                    Thank you, Just one more question.

                    How to color the lbounds and the ubounds to different colours and as I see the RegionHighlightY isn't available in NT7. What other tool can I make it in NT7?

                    Comment


                      #11
                      For NinjaTrader 7, you would indeed use the DrawRegion method,



                      I have attached some example code for NinjaTrader 7. I'm happy to be of further assistance if possible.
                      Attached Files
                      Jessica P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by sightcareclickhere, Today, 01:55 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post sightcareclickhere  
                      Started by Mindset, 05-06-2023, 09:03 PM
                      9 responses
                      258 views
                      0 likes
                      Last Post ender_wiggum  
                      Started by Mizzouman1, Today, 07:35 AM
                      4 responses
                      18 views
                      0 likes
                      Last Post Mizzouman1  
                      Started by philmg, Today, 01:17 PM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_ChristopherJ  
                      Started by cre8able, Today, 01:01 PM
                      1 response
                      9 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Working...
                      X