Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 22:06:23 +0000



[Programming Help] - New Bar formation

View Count: 607

[2018-12-07 11:50:17]
User48838 - Posts: 112
Can someone please help me understand how to tell if a new bar has formed in a Spreadsheet Study, I have tried checking cell J41 for a seconds value =0 and G3 for # of trades =1, but i haven't found them to be reliable. Right now I am checking "second($J$41)" for a value <=2 which seems reliable (after hours, so far). I am using 1 minute ES bars at this time. TY.
[2018-12-07 15:53:42]
Sawtooth - Posts: 3976
Try this:
=AND($J$41>A3,$J$41<A3+30/86400)

The timing accuracy of this depends on how often J41 updates.
IOW, it would go TRUE more quickly at a new bar in a fast market, and possibly be late in a slow market.

You could use a shorter window than 30 seconds to look for a TRUE, but J41 might not update in a very short window, and a TRUE would be missed for that new bar. Using 30 seconds will at least give you a TRUE/FALSE transition in most cases.

30/86400 = 30 seconds in Serial DateTime Value.
Spreadsheet Example Formulas and Usage: Using Date Time
Date Time Of Last Edit: 2018-12-07 16:04:33

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account