Announcement

Collapse
No announcement yet.

Compute when bar completes not when next bar arrives

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

  • Compute when bar completes not when next bar arrives

    Compute on close is really compute on next bar tick...

    I want an indicator running on a daily chart to display the value on the last bar when it closes. I don't want it to update on each tick during the day. Right now I am looking at a chart on Saturday and the Friday value has not computed...

    The problem with all of the BARSTATE conditions is that there is no way (that I know) of to determine when the last tick has arrived. On Friday close I have to wait until Monday open to see the Friday close update of an indicator on a chart.

    How can I really have compute on close of the last bar without waiting for the next trading day to open? If I applied a time template to a chart I can test for market hours but if the market closes early this doesn't work.
    ....Mike

  • #2
    The only way I know to accomplish this is to use setComputeOnClose(true), but this forces your entire EFS to run only once (when the bar completes).

    For years, I have developed efs code that simply waits for a new bar to form, then check the previous bar for triggers/signals because it's essentially the same thing.

    You need to remember that EFS operates based on ticks. There is no guarantee that a tick will form in the last second of a bar. Thus, this is going to be something you'll have to test on your end to see how you want to deploy it.
    Last edited by Doji3333; 07-06-2010, 10:18 AM.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment

    Working...
    X