Announcement

Collapse
No announcement yet.

How to generate horizontal line based on study value as of last bar only?

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

  • How to generate horizontal line based on study value as of last bar only?

    Hi. I am trying to use Formula Wizard to generate a horizontal line that is X true ranges above the close of the most recent bar on the chart.

    I need to determine one true range value only, which would be the true range as of the most recent bar.

    So my formula would 1) calculate the TR as of the most recent bar, 2) add some multiple of TR to the C of the most recent bar, and 3) draw a horizontal line at Y = the resulting sum of the values.

    My best approximation so far (in the "Returned Data Points" window) is:


    X * vATR[# bars].getValue(ATRStudy.ATR) + getValueAbsolute("Close")


    which draws a horizontal line at Y = the most recent close + the TR as of the current (not most recent) bar.

    I would appreciate any suggestions for how to generate a line based only on the price and true-range data as of the one most recent bar. Thanks.

  • #2
    Hindenburg:

    Attached is a sample script that should at least get you headed in the right direction. It is a 'regular' script (e.g., not generated by the Formula Wizard) but it is pretty easy to follow the logic if you load it into your eSignal Editor.

    Chris
    Attached Files

    Comment


    • #3
      Thanks.

      Comment

      Working...
      X