Announcement

Collapse
No announcement yet.

Toggle Buttons And Mouse Clicks

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

  • Toggle Buttons And Mouse Clicks

    I'm trying to draw some trend lines on a chart by clicking the mouse, but i require a toggle button so as i can click the chart to move around and not have the lines drawn on the chart, ie, if the toggle as on, every click would draw a trend line where i clicked to the end of the screen, when the toggle is off, i can click the chart and move it or whatever, but the trend lines are no longer drawn. I've included a clear button as well, so the lines will stay on the chart till i clear them.
    The other problem is i want to be able to draw 3 trend lines, so 1 with the first click, another with the second click, than after that i can click as many times as i like and the final trend line moves where ever i click.
    I've attached the current efs file which seems to have an error when i try to draw any of the trend lines currently, and the toggle button doesn't show up either.
    Attached Files

  • #2
    Yes,

    I'd like to have a button that allows a toggle which will draw line segments as per the vertical/horizontal placement of the crosshair cursor - so this efs would be really useful.

    Anyone had a chance to have a look?

    thanks

    Comment


    • #3
      I don't have alot of time to address this because I dealing with a family emergency right now, but I can tell you the way you are trying to address this is incorrect. You can't simply draw lines from point a to point b on the chart (unless you only want STATIC lines). If you want dynamic lines that automatically extend and draw when new bars are added to the chart, then you have to store certain necessary data into a data array that can be used to redraw lines as needed.

      As I've stated, I developed something like this for a client, but it took about 4+ hours of work to complete. So, it can be done, but because I've been contracted to do this for other people, I can't just give it away.

      the advice I can offer you is you need to store the click data into an array (using an object) then create a "process" to track a start click and end click for each line.

      it's the only way to do it properly. If you don't do i like this, then you'll end up with a mess that does not work the way you expect.
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment


      • #4
        BigBoyLines

        Hi BigBoy,

        I've fixed up your code so it will work the way I think you want it to... but as Brad stated, to have this auto-extend on new bars received would be a bit more work.

        Have fun with this and let me know if I properly captured your intent...

        Regards,
        Ryan.
        Attached Files

        Comment


        • #5
          Hi Ryan,

          Thank you very much, the code is perfect, does exactly what i needed. Feel like an idiot looking at it and how i missed something as simple as a true/false value, tried so many things but that never crossed my mind,

          Thanks again

          BigBoy

          Comment


          • #6
            Glad to hear it now does what you intended it to do... Cheers!

            Regards,
            Ryan.

            Comment

            Working...
            X