• 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

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:
                          AddPlot(Brushes.DarkCyan, "Plot0");
                          AddPlot(Brushes.Magenta, "Plot1");
                          AddPlot(Brushes.Yellow, "Plot2");
                          AddPlot(Brushes.DarkGray, "Plot3");

          And this code set their values,


          Code:
                      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]);

          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,

                      http://ninjatrader.com/support/helpG...drawregion.htm

                      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 sun0781, Today, 05:02 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post sun0781
                      by sun0781
                       
                      Started by ronhb107, 09-12-2019, 10:09 AM
                      4 responses
                      41 views
                      0 likes
                      Last Post Mr.Trader  
                      Started by rwilliam, Today, 03:55 PM
                      0 responses
                      3 views
                      0 likes
                      Last Post rwilliam  
                      Started by asmmbillah, Today, 03:42 PM
                      2 responses
                      7 views
                      0 likes
                      Last Post asmmbillah  
                      Started by NT-Roland, Today, 03:25 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post NT-Roland  
                      Working...
                      X