Announcement

Collapse
No announcement yet.

EFS generated lines not straight

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

  • EFS generated lines not straight

    How do I keep the lines displayed to be straight?

    any statements I should add to EFS?

    See attached.
    Attached Files

  • #2
    Robert,

    How are those lines generated?

    G
    Garth

    Comment


    • #3
      Possible Solution....

      If you are using drawLineRelative to create these lines, then simply extend the X1 value to the current bar and leave the others (X0, Y0, Y1) the same. Y0 and Y1 shoud be the price you want the line drawn at and XO is the starting bar.

      Because esignal counts bars in a NEGATIVE manner, I have used a function to automatically recalc the bar numbers. To do this....

      Create a BARCOUNTER - as a global variable (outside main()).
      and...
      Create a timestamp variable.


      var BarCounter = 0;
      var BarCounterTimeStamp = 0;

      Then, within main(), increment the barcounter with each new bar - like this...

      if (getValue('rawtime",0) != BarCounterTimeStamp) {
      BarCounterTimeStamp = getValue("rawtime",0);
      BarCounter += 1;
      }

      This will allow you to keep a running count of the bars on the chart.

      Now, let's say we identified a new line start at bar count 101 (and there are a total of 200 bars on our chart). We would need to record the bar number where the line starts (ie: 101) and the price.

      Line1BarStart = BarCounter;
      Line1StartPrice = close();

      When issuing the draw command, we simple subtract the BARSTART variable from the total BarCount to calculate the relative (Negative) bar number...

      drawLineRelative(Line1BarStart-BarCounter, Line1StartPrice, 0, Line1StartPrice, PS_SOLID,1,Color.blue,"Line1");

      To make this line automatically update with each bar, you simply need to re-issue the drawLineRelative statement at the end of your script and keep the TAG parameter "Line1" the same for each line. If you have more than one line, then you would have "Line1", "Line2".....

      If you are drawing these lines with "Return" values within your EFS file, then you simply need to return the same value throughout the execution of your script.

      I hope this helps..

      Brad
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment


      • #4
        Thanks guys for your response.

        I will first try the codes used in pivot efs

        pivot lines does not seem to bend like that

        they stayed straight all day long

        Comment

        Working...
        X