Announcement

Collapse
No announcement yet.

adding bands to RSI

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

  • adding bands to RSI

    if I want to add bands to the rsi indicator - for instance I whould like to be able to have 2 sets of bands for a total of 4 bands in two separate colors (red and black)

    red
    range of the bands - 20 to 30
    55 to 65

    black
    range 80 to 90
    40 to 50


    if someone could help Id greatly appreciate it.


    Graham

  • #2
    Graham
    Use the addBand() command. Here are the parameters (copied from the EFS Help Center and Library)
    Alex

    addBand( dValue, nStyle, nThickness, Color, TagName )

    dValue: y-axis value to place the band
    nStyle: the pen style to draw with
    nThickness: thickness of the line (in pixels)
    Color: a RGB color value
    TagName: A unique identifier for this text object.

    Example:
    addBand(80.0, PS_SOLID, 1, Color.red, 1);

    Comment


    • #3
      almost there

      thanks Alexis,
      I only have one remaining question then :
      the value for D
      in the example you have given me, the value is 80
      how do I make the value a range
      like 80 - 90
      I want to make a very thick band that covers the area of 80 all the way to 90.

      Graham

      Comment


      • #4
        Graham
        As far as I can see lines are plotted around a center value which is the parameter you define (in the case of addBand it is the first parameter).
        As you make the line thicker (for example 10 pixels) it is plotted 5 pixels on either side of 90 if this is the parameter you set.
        Therefore what you want to do is take the middle value between 90 and 80 and then plot a band 15 pixels in thickness plus or minus a pixel. At this point the band should cover the range from 80 to 90.
        Here is the command

        addBand(85,PS_SOLID,15,Color.lightgrey,#);

        NOTE: Substitute the # sign with the appropriate Tagname

        Repeat the same process for the other bands you want to add to the RSI study.
        Alex

        Comment


        • #5
          band problem

          Hi Alexis,
          by the way I accidently posted this reply as a new thread - so just ignore the dupe.
          sorry to be a pain in the --- over this issue - but if I can get this done, I would have something very important to me.

          I hear what you're saying about adjusting the pixel size to cover the area of the desired band thickness. I was taking the horizontal trendline before and specifying a thickness of say 20,
          and doing this manuelly. The problem with it is that once you have you're bands setup properly, you are now restricted to having the indicator study (in this case RSI) fixed to a certain screen size.
          It would become a hassle to add other indicator in that its not a very universall solution. If for whatever reason I needed to enlarge the indicator portion of the chart, the bands whould be in different values now, because of the FIXED pixel size written to the code.
          When I was doing this by hand with trendlines before, it was very time consuming and there was a generall feeling of "dont anyone dare TOUCH that chart" !
          Of course if the was a range specified in the code for the values the bands would cover...
          what about a solutiuon like adding the entire whloe number range? for instance : if I want 80 thru 90 to be a solid band couldnt I write in the code 80, 81, 82, 83, 84, .... up to 90 ?
          I'm not sure as you're the one with the knowledge of code.
          I appreciate you're time much,
          Graham

          Comment


          • #6
            Graham
            If I may make a suggestion try one thing before you go the way of plotting a line for every point in between your values (mind you I am not implying it is wrong, just trying to save you some aggravation)
            First of all make sure that you have a setChartMin(0) and setChartMax(100) in preMain. This should help in maintaining proportionality.
            Then set a band at 80 thickness 1 and a band at 90 thickness 1 also. Then create a band at 85 with a thickness of approximately 15. At this point you can visualize what effect changing the size of the indicator pane has on the thicker band. You may find that it is within an acceptable tolerance.
            I really have no idea what impact - if any - there is in having that many bands in a study. So, an alternate solution might be to set a band with a thickness of 3 or 4 every 2 points (ie 81, 83, 85, etc).
            Just some ideas
            Alex
            Last edited by ACM; 06-01-2003, 09:19 AM.

            Comment


            • #7
              how to

              Alexis,
              I attached the modified file that I've been working on and like I said before I have the bands just how I want them.
              What I want to do now is make the line (rsi line) thicker and a different color.
              I did go to the libray and try to use the command - setPlotType
              but to a complete failure. How do I make the line thicker and a different color?
              Graham
              Attached Files

              Comment


              • #8
                duhh!

                I just stumbled upon the answer by going to the edit studies and doing the modifing there.
                sorry for all this neddless reading
                Graham

                Comment


                • #9
                  Graham
                  Attached is the efs with the additional commands that will allow you to modify color and thickness of the RSI plot.
                  See Lines 10 and 11 of the formula.
                  Using Edit Studies is another way of doing it, but it is not permanent.
                  Alex
                  Attached Files

                  Comment


                  • #10
                    all set

                    Perfect!
                    Have a great day!
                    Graham

                    Comment

                    Working...
                    X