Announcement

Collapse
No announcement yet.

Drawing lines with high and low prices

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

  • Drawing lines with high and low prices

    I am trying to figure out how to add to my EFS script such that when my conditions are all true, the EFS draws two horizontal lines the entire way across the chart. One line at the high and one line at the low. At the end of the high line I would like it to show the bar's high price. Same thing for the low line. Any ideas? EFS Script is attached.

    Thanks
    Attached Files

  • #2
    you would have to use the drawLineRelative feature of EFS to draw the lines you want. Here is an example..

    drawLineRelative(-1,PriceLevel,0,PriceLevel, PS_SOLID, 2, Color.grey, "St+"+BarCounter);

    Notice the -1,PriceLevel,0,PriceLevel. These values determine where the line is drawn. In this example, the line is drawn from the previous bar to the current bar (-1 to 0) @ PriceLevel.

    Notice at the end of this function is a TAG (graphic identifier), "St+"+BarCounter. All graphics in EFS use this TAG identifier as a unique ID for the the graphic being drawn. You really have to think sometimes about how you want to address drawing functions because you don't want to draw a bunch of lines/graphics/text on a chart and have many thousands of unused and unwanted graphics eating up resources.

    I looked at your code and depending on which ACTIONS you wanted to have draw lines, it really would not take too much work to get it operating the way you want. I would just have to add some additional logic and variables to handle your requirements. We may have to drop the "setComputeOnClose()" function and re-write your EFS to operate a bit differently so the graphics update in Realtime.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment

    Working...
    X