Announcement

Collapse
No announcement yet.

How do you draw a variable-sized circle?

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

  • How do you draw a variable-sized circle?

    Is there any way that I can draw a circle so I can control the size? The only way I can find to draw a circle is using drawShapeRelative, which draws a small circle, but I see no way to control the size of it.

    Dale

  • #2
    Look up Wingdings in the search engine and you will see how to add shapes using drawtext to control the font size and color, I believe.

    Comment


    • #3
      It seems like a kinda klugy way to do it, but it should work for my purposes.

      Thanks, David!

      Dale

      Comment


      • #4
        tasman
        Depending on what you need to do you also have available
        addLineTool(LineTool.CIRCLE, x1, y1, x2, y2, nThickness, Color, Name);
        with the corresponding commands
        clearLineTool( Type )
        removeLineTool( Type, Name )
        Alex

        Comment


        • #5
          Thanks Alex, but I couldn't get addLineTool to work. I copied the entire example out of EFS help and tried that, but all I got were the lines, no circle.

          Dale

          Comment


          • #6
            Dale
            Try the enclosed code on a daily chart of the Dow. The result should be similar to what is in the image below
            Alex




            PHP Code:
            function preMain() {
                
            setPriceStudy(true);
                
            setStudyTitle("sample");
            }

            function 
            main() {
                if(
            getCurrentBarIndex() == 0) {
                    
                    
            addLineTool(LineTool.CIRCLE, -8high()+508low()-501Color.blue"circle1");
                }


            Comment


            • #7
              Thanks Alex, but I tried your code and all I got was a vertical line at -8 and another at +8.

              I don't know if it makes any difference, but I am currently running beta version 7.5 build 619. I had a newer version running, but had to go back to this one due to a problem I was having with Pages.

              Dale

              Comment


              • #8
                Dale
                Are you getting that result when plotting it on a daily chart of the Dow?
                I think you may have it on some other symbol/interval and what you are seeing is just a portion of of a circle that is very extended vertically (the upper and lower points of the circle are 100+ points apart).
                Akex

                Comment


                • #9
                  Alex,

                  I am using ES #F. I had to change the price almost to a flat line to see the circle shape. I can see by this that it will take some practice to get an actual circle as the price range being displayed changes.

                  I also noticed that the circle disappears some times and comes back again. I am guessing that this is due to the circle being drawn over itself and effectively getting erased. Sometimes the circle elongates and I get more than one circular chape.

                  Interesting.

                  Dale

                  Comment


                  • #10
                    Dale

                    it will take some practice to get an actual circle

                    That is why in my original reply I did preface by saying "depending on your needs". Never the less it is one more tool available in the arsenal.
                    As to getting more than one shape that should happen every time a new bar comes in as I did not set any uniqueIDs or use the the removeLineTool() command.

                    Alex

                    Comment


                    • #11
                      CIRCLE FUNCTION REQUIRES MODIFICATION

                      Dear sirs,

                      Please modify/create_new CIRCLE function.

                      From a computer scientist point of view,
                      it seems that chart developers would find it more useful to have the following CIRCLE function

                      * addLineTool(
                      LineTool.POINT,
                      x_position,
                      y_position,
                      radius,
                      Fill.[TRANSPARENT,SOLID,PATTERN,...]
                      Color.XXX,
                      "circle1"
                      );

                      where radius is a multiple of x_width.




                      Dr.

                      Comment


                      • #12
                        Circle Line tools

                        This is great that they are becoming serious about this basic drawing tool.

                        I'd like to see them remove or disable the text on the fibonnaci circle tool. That goes for the standard line fibonacci tool also. Sounds easy enough to do?


                        One step closer

                        Comment

                        Working...
                        X