Announcement

Collapse
No announcement yet.

Another mouse function idea

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

  • Another mouse function idea

    I was curious if anyone had developed a mouse function efs that would allow one to click on a bar/candle. And get the values of the OHLC also the midpoint (otherwise know as waste). The values would be displayed in the chart possibly in the corner.

    I am very interested in this if anyone could give their input?

    Sincerely,

    Fibbgann
    Excellent book on JavaScript for beginners

  • #2
    FibbGann
    Not sure you need a mouse function to do that.
    Try the enclosed efs which will give you the value of the waist (ie open+close)/2 as I understand it) in the Cursor Window
    Alex



    PHP Code:
    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("Waist");
        
    setCursorLabelName("Waist");
          
    }
    function 
    main() {

    var 
    vWaist = (open()+close())/2;


    return 
    formatPriceNumber(vWaist)+"";

    Comment


    • #3
      Thanks Alex, (by the way I am a Fut's man now)

      I wanted to be able to click on any candle I wanted and receive the open, close, high, low and waist displayed in the chart. (not cursor)

      I was looking at Chris's Mouse function helper in his help file that will allow the numbers of 2 separate candles. Just have to get it to retreive the data I inquired about intead of barindex and Yvalue

      PHP Code:
      function preMain() {

      setPriceStudy(true);
      setStudyTitle("Left Mouse Button Clicks");
      setShowCursorLabel(false);

      }

      function 
      main() {

      }

      function 
      onLButtonDownbarIndex,  yValue) {

      debugPrintln("LeftDown: " barIndex ", " yValue);
      updateClickInfo(barIndexyValue);

      }

      function 
      onLButtonDblClkbarIndex,  yValue) {

      debugPrintln("LeftDblClk: " barIndex ", " yValue);
      updateDblClickInfo(barIndexyValue);

      }

      function 
      updateClickInfo(barIndexyValue) {

      drawTextAbsolute(515"Clicked bar " barIndex " at " yValue.toFixed(2),

      Color.whiteColor.navyText.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLD,
      null14"ClickInfo");

      }

      function 
      updateDblClickInfo(barIndexyValue) {

      drawTextAbsolute(535

      "Double Clicked bar " barIndex " at " yValue.toFixed(2), 
      Color.whiteColor.navy
      Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLD,
      null14"DblClickInfo");


      Fibbgann
      Excellent book on JavaScript for beginners

      Comment


      • #4
        If you have the bar index, then you can use the open(), close(), high(), low() functions using that index.

        Garth
        Garth

        Comment


        • #5
          Thats what I thought Garth, I just messed up somewhere trying to get to the bottum of it.

          Fibbgan
          Excellent book on JavaScript for beginners

          Comment


          • #6
            FibbGann
            Attached is Chris' example modified to write OHLC and Waist
            Alex

            Attached Files

            Comment


            • #7
              Alex, I just got it when you posted.




              As always thank you!


              Fibbgann
              Attached Files
              Excellent book on JavaScript for beginners

              Comment


              • #8
                I want to input .toFixed(2) Would I be better off doing some variants. and pluging them into Function main or is there a simpler way to do this.


                Fibbgann
                Last edited by FibbGann; 04-25-2004, 10:03 PM.
                Excellent book on JavaScript for beginners

                Comment


                • #9
                  FibbGann
                  You could use formatPriceNumber() in the drawTextAbsolute command so it writes the prices in the way in which they are actually displayed on the chart (see example that follows)
                  formatPriceNumber(open(barIndex))
                  Alex

                  Comment


                  • #10
                    Alex, I never used that function before, but I will now. Could'nt figure out how to get it to work on the Waist numbers. (no biggy)

                    Here is an efs I just started to mess with (thanks to the help of Alex, Garth and Steve)

                    Check it out and I will get into the depth and dialog later when I get a chance.

                    It needs help no doubt, but can be used for a great tool for those that use S/R's.

                    Enjoy the rough draft!

                    Fibbgann
                    Attached Files
                    Last edited by FibbGann; 04-26-2004, 12:34 AM.
                    Excellent book on JavaScript for beginners

                    Comment


                    • #11
                      FibbGann
                      I think this should work
                      formatPriceNumber((open(barIndex) + close(barIndex)) /2)
                      Alex

                      Comment


                      • #12
                        Call me mouse function crazy! Here an other mouse function efs that will allow you to click on bars (2) and it will draw line and display text of the OHLCW (W=waist) It will also send the number to the "formula out put" window too.

                        Just a rough draft, I have a major project I am going to work on for awhile.

                        Fibbgann
                        Attached Files
                        Excellent book on JavaScript for beginners

                        Comment


                        • #13
                          I sample pic.

                          Fibbgann
                          Attached Files
                          Excellent book on JavaScript for beginners

                          Comment

                          Working...
                          X