Announcement

Collapse
No announcement yet.

Drawing functions Q

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

  • Drawing functions Q

    Hi,

    Is there a way to keep a Text/Shape etc. at fixed distance [in pixels] from, say, high or low of a bar?

    For Example, y=High(offset)+15 Pixels.

    Apparently [from Doc/Help], DrawRelative does not accept Pixels in y calculation and DrawPixels does not accept a price reference.

    Thank you.

    Mihai
    Mihai Buta

  • #2
    Hello Mihai,

    With the release of EFS2 there were two new functions added to allow users to accomplish this very task, drawText() and drawShape(). Although these functions do not allow you to specify a specific pixel amount for the spacing they do give you four locations above the bar and below the bar.

    AboveBar1
    AboveBar2
    AboveBar3
    AboveBar4
    BelowBar1
    BelowBar2
    BelowBar3
    BelowBar4

    In addition to these 8 locations, you also have 8 more locations that are relative to the top and bottom of the window. These are referred to as the top rows and bottom rows.

    TopRow1
    TopRow2
    TopRow3
    TopRow4
    BottomRow1
    BottomRow2
    BottomRow3
    BottomRow4

    Here's a basic code example.

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

    function 
    main() {
            
    drawText("X"AboveBar1Color.bluenull"abar1"); 
            
    drawText("X"AboveBar2Color.bluenull"abar2"); 
            
    drawText("X"AboveBar3Color.bluenull"abar3"); 
            
    drawText("X"AboveBar4Color.bluenull"abar4"); 

            
    drawShape(Shape.CIRCLEBelowBar1Color.blue"bbar1"); 
            
    drawShape(Shape.CIRCLEBelowBar2Color.blue"bbar2"); 
            
    drawShape(Shape.CIRCLEBelowBar3Color.blue"bbar3"); 
            
    drawShape(Shape.CIRCLEBelowBar4Color.blue"bbar4"); 

            return;




    Try replacing the location constants with the TopRow or BottomRow constants to see what that looks like.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Jason,

      Thank you.

      I did try to use DrawText/DrawShape and, as expected, they do not take BarOffset as parameter. Draw all Shpes/Texts at the last bar.
      I also tried to use those [very good] parameters in DrawRelative but does not work either.

      Is there any other way?

      Thank you.
      Mihai
      Last edited by mbuta; 06-13-2006, 03:59 PM.
      Mihai Buta

      Comment


      • #4
        Yes, you can use the AboveBar and BelowBar constants with the drawTextRelative() function.... you just need to 'activate' that functionality by using the Text.PRESET flag. Example:


        PHP Code:
        drawTextRelative0AboveBar1"B"Color.rednullText.PRESET Text.BOLDnull12 ); 
        Chris

        Comment


        • #5
          Thank you Chris,

          Now I saw it in the Help also.

          Note: I may not be to bright, but would not hurt [given that many of us are not "proffessional coders"] to make it more explicit than it is now.

          If nothing else, some examples showing the use of NEW features like this, is a minimum

          For one, I know I tried to understand it, but could not, although I have a good track record of reading specifications [former computer architect for IBM mainframe storage systems].

          Additional Note: I see Shape.PRESET is not mentioned at all. I assume it is available!


          Thanks again,
          Mihai
          Last edited by mbuta; 06-14-2006, 10:08 AM.
          Mihai Buta

          Comment


          • #6
            Sorry, but could not make it work.
            I use the same line as before just replaced the "y" and changed Flags to include .PRESET.

            It works if I "manufacture" y from high/low, does not when use AboveBar/BelowBar.


            Mihai
            Mihai Buta

            Comment


            • #7
              Mihai

              Additional Note: I see Shape.PRESET is not mentioned at all. I assume it is available!
              Shape.PRESET is mentioned in both drawShapeRelative() and drawShapeAbsolute()
              Alex



              Originally posted by mbuta
              Thank you Chris,

              Now I saw it in the Help also.

              Note: I may not be to bright, but would not hurt [given that many of us are not "proffessional coders"] to make it more explicit than it is now.

              If nothing else, some examples showing the use of NEW features like this, is a minimum

              For one, I know I tried to understand it, but could not, although I have a good track record of reading specifications [former computer architect for IBM mainframe storage systems].

              Additional Note: I see Shape.PRESET is not mentioned at all. I assume it is available!


              Thanks again,
              Mihai

              Comment


              • #8
                Hello Mihai,

                The code snippet Chris posted works fine. Please post the code you are using so we can see what the difference might be.
                Jason K.
                Project Manager
                eSignal - an Interactive Data company

                EFS KnowledgeBase
                JavaScript for EFS Video Series
                EFS Beginner Tutorial Series
                EFS Glossary
                Custom EFS Development Policy

                New User Orientation

                Comment


                • #9
                  Jason,

                  I copied Chris' line directly in my efs and does not work.


                  Alex,

                  There is no Shape.PRESET in my Help file.

                  But, I am using 7.91 Buid 738 which might be the cause.

                  Unfortunatelly, eSignal does not alert its users [like all respectable programs] when they are using an outdated version!!!

                  I will report if that was the problem.

                  Thank you,
                  Mihai
                  Mihai Buta

                  Comment


                  • #10
                    1. I did upgrade to 8.0 but the problem is not solved.

                    2. Not plotting correctly of AboveBar/BelowBar was a known bug and was supposed to be fixed in this version.

                    3. My Help file [I am talking about the file that opens with "?" from EFS Editor] still does not have Shape.RESET.

                    This tells me that either [a] the bug was not fixed, or [b] not all files, particularly those pertaining to EFS are not updated.

                    I don't know what else to do. My EFS it is fine, for sure.

                    Note: Simple problem that should take no time to solve, takes forever!!

                    Mihai Buta
                    Mihai Buta

                    Comment


                    • #11
                      I did even more: unistalled eSignal, deleted eSignal directory, re-installed eSighal, still same result and Shape.PRESET in not in my Help file.

                      I don't know what you guys are looking at, but whatever it is, apparently, is not available for general public [unless I am doing something very stupid here].

                      Out of curiosity: How did they know to recover my old Time Templates, which I forgot to save before deleting s/w?!?!
                      [I did save Formulas and Pages]

                      Mihai
                      Last edited by mbuta; 06-14-2006, 04:33 PM.
                      Mihai Buta

                      Comment


                      • #12
                        Mihai

                        I don't know what you guys are looking at, but whatever it is, apparently, is not available for general public [unless I am doing something very stupid here]
                        That information is in the EFS KnowledgeBase and is available to everyone.
                        See drawShapeAbsolute() and drawShapeRelative()
                        Alex


                        Originally posted by mbuta
                        I did even more: unistalled eSignal, deleted eSignal directory, re-installed eSighal, still same result and Shape.PRESET in not in my Help file.

                        I don't know what you guys are looking at, but whatever it is, apparently, is not available for general public [unless I am doing something very stupid here].

                        Out of curiosity: How did they know to recover my old Time Templates, which I forgot to save before deleting s/w?!?!
                        [I did save Formulas and Pages]

                        Mihai

                        Comment


                        • #13
                          Alex.

                          I am not using Knowledge Base. I am using EFS Editor and there, it is not. And AboveBar/BelowBar don't work from Version 8.0 downloaded from eSignal website.

                          I would be gratefull to anybody who has an working example of using AboveBar/BelowBar using the same version of eSignal available to us [downloaded from eSignal site].

                          Thank you very much.
                          Mihai buta
                          Mihai Buta

                          Comment


                          • #14
                            did you try

                            drawText( "Buy", BottomRow2 );

                            that probably doesnt help either.

                            Comment


                            • #15
                              Mihai
                              AboveBar/BelowBar work fine at my end using version 8.0 (build 779) downloaded from the web site
                              If it is not working with your code then post your code as indicated in the PLEASE READ: Posting Guidelines for EFS Studies Forum
                              Alex


                              Originally posted by mbuta
                              Alex.

                              I am not using Knowledge Base. I am using EFS Editor and there, it is not. And AboveBar/BelowBar don't work from Version 8.0 downloaded from eSignal website.

                              I would be gratefull to anybody who has an working example of using AboveBar/BelowBar using the same version of eSignal available to us [downloaded from eSignal site].

                              Thank you very much.
                              Mihai buta

                              Comment

                              Working...
                              X