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...
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.
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.
Comment