Announcement

Collapse
No announcement yet.

LineTool.RAY goofing up?

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

  • LineTool.RAY goofing up?

    Can someone explain to me the proper way to make a simple ray line plot properly?

    When I try to execute my ray, it goes NUTS and draws a zillion different rays all over the chart and I can't figure out why.

    Maybe it's that I don't understand how the Ray is supposed to be used in the first place. Can it be used just as the same manner as a drawLineRelative?

    It's probably an issue with my programming, but I'm too embarrased to post my code. lol...

    Last edited by TheRonin; 09-09-2005, 01:42 PM.

  • #2
    TheRonin
    Add a clearLineTool(LineTool.RAY) at the beginning of main.
    Alex

    Comment


    • #3
      TheRonin,

      Here is the sample efs showing how to use the different linetool shapes. Run this efs, then play around with the variable values. You can also comment some of the lines out to figure out which line is which by placing // at the beginning of the line. I believe this will be of some help.

      PHP Code:
      function preMain() { 

         
      setPriceStudy(true); 
         
      setStudyTitle("linetool"); 



      function 
      main() { 
      var 
      c

         if( 
      getCurrentBarIndex() == ) { 

            
      close(0); 

            
      addLineToolLineTool.HORZc2Color.blue"horz1" ); 
            
      addLineToolLineTool.VERT, -342Color.blue"vert1" ); 
            
      addLineToolLineTool.ARROW, -104c-5, -69c-42Color.blue"arrow1" ); 
            
      addLineToolLineTool.SEGMENT, -104c-4, -69c-32Color.blue"segment1" ); 
            
      addLineToolLineTool.RAY, -104c-3, -69c-22Color.blue"ray" ); 
            
      addLineToolLineTool.EXTENDED, -104c-2, -69c-12Color.blue"extended" ); 
            
      addLineToolLineTool.REGRESSION, -104, -691Color.blue"reg1" ); 
            
      addLineToolLineTool.CIRCLE, -50c, -34c1Color.blue"circle1" ); 

         } 


      Comment


      • #4
        Ok guys, I played with the settings to try and figure out HOW it's working and I am still lost.
        But, one thing I have "fixed" is the rediculous uncontrolled plotting it was doing earlyer.

        I also attempted a clearLineTool in main, but it gave me errors.

        All I ask is if someone can explain how it works...?

        I played with many settings and it doesn't plot the way I want it to. It appears to be off slightly all the time.

        PHP Code:
        addLineToolLineTool.RAY, -104c-3, -69c-22Color.blue"ray" );

        where -140 is x1 c-3 is x2 (which defines point 1?)
        then -69 is y1c-2 is y2 (which defines point 2?) 
        But, when I define my points of "which bar" and "where on the bar", it seems that it ignores my request and does something "close" to what I want instead of exactly

        Comment


        • #5
          All I ask is if someone can explain how it works...?
          addLineTool( LineTool.RAY, -104, c-3, -69, c-2, 2, Color.blue, "ray" );

          where -140 is x1 , c-3 is x2 (which defines point 1?)
          then -69 is y1, c-2 is y2 (which defines point 2?)

          Ok Ronin, the help file has the documentation you need. Another source is the knowledgebase. Regarding the help file, it is in the Signal folder. C:\Program Files\eSignal\eSignalEFS2.chm

          take a look at an excerpt from the help file

          Line Tool Variations

          addLineTool(LineTool.MOB, x, y, name);
          addLineTool(LineTool.ELLIPSE, x1, x2, name);
          addLineTool(LineTool.HORZ, y, nThickness, Color, name);
          addLineTool(LineTool.VERT, x, nThickness, Color, name);
          addLineTool(LineTool.REGRESSION, x1, x2, nThickness, Color, name);
          addLineTool(LineTool.ARROW, x1, y1, x2, y2, nThickness, Color, name);
          addLineTool(LineTool.SEGMENT, x1, y1, x2, y2, nThickness, Color, name);
          addLineTool(LineTool.RAY, x1, y1, x2, y2, nThickness, Color, name);
          addLineTool(LineTool.EXTENDED, x1, y1, x2, y2, nThickness, Color, name);
          addLineTool(LineTool.CIRCLE, x1, y1, x2, y2, nThickness, Color, name);

          based on your post you appear to be putting the point coordinates in this order as x1,x2,y1,y2 whereas the correct format is x1,y1,x2,y2

          The x values are the offset from the current bar (horizontal axis). The y values are the location on the vertical axis.

          The documentation for the clearLineTool and another tool, removeLineTool() are both in the help file.

          I hope this is of some help.

          Comment


          • #6
            Whoops, that's what I meant.

            I suppose I have to do some more research on my own to figure this out then. Thanks for the advice thus far.

            Comment


            • #7
              Here are 2 things to try.

              First: add in your preMain setComputeClose()

              This will only allow an update on a new bar

              Second:

              If you are setting your addlinetool via a varible that is using a getValue change it to getValueAbsolute

              see if 1 or both of those solve your problem

              Comment

              Working...
              X