Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 00:15:33 +0000



[User Discussion] - CountDown Timer Alert Code

View Count: 1441

[2020-11-22 04:40:34]
User414533 - Posts: 89
I used the following code (=ID1.SG1 < 30) on a 5M chart and did not hear an alarm trigger 30 secs prior to candle close.

Also, I would like the code to trigger an alert on a "number of trades per bar" chart; "100", "200", "300" ticks remaining in bar, for example.
Date Time Of Last Edit: 2020-11-22 04:41:36
[2020-11-22 13:17:48]
Sawtooth - Posts: 3976
Set 'Display Value Only' to Yes.

Limitations:
If you Hide the study, you lose its output.
If you want to hide its display, you must choose colors to match the chart background.
If you want the default display, you must use another instance.

Here's another way using a spreadsheet study:
https://www.sawtoothtrade.com/free-stuff-11.html
Date Time Of Last Edit: 2020-11-22 13:25:09
[2020-11-22 15:39:52]
User414533 - Posts: 89
"Display Value Only" was set to "yes" as default.

I toggled it off and on and still no alert.

I have no experience working with spreadsheet studies. :/
[2020-11-22 22:31:35]
Sawtooth - Posts: 3976
It works for me. Maybe the alert is not Enabled, or the Alert Sound is set to No Alert Sound.

With 'Display Value Only' set to Yes, the CountDown Timer Study outputs a value that can be used in an alert formula.

You can test this visually in two ways, using Replay Chart:
1. Add the Color Bar Based On Alert Condition study and put the =ID1.SG1 < 30 formula on its Alerts tab (Assuming the CountDown Timer study is ID1).
When the alert is FALSE, you will see all price bars colored except the current bar; when the alert is TRUE, you will see all price bars colored including the current bar.
2. Move the CountDown Timer study to the top of the Studies to Graph list, then add the Spreadsheet Study study. You will see the CountDown Timer's output in row 3 of column AA. You will notice that all rows are 0 except row 3 (Row 3 is the current bar, earlier bars are in rows below).

The spreadsheet study linked in post #2 is not difficult to use. If you add that custom study to Chart 1, just set the times and thresholds in the colored cells. If you add it to another chart#, you'll need to copy/paste the those user input cells to another sheet. Let me know if you need help with this.
[2020-11-23 04:00:35]
User414533 - Posts: 89
(Assuming the CountDown Timer study is ID1).

Noob alert! I was copying the code straight across without setting the accurate corresponding "ID". >_<

Everything is working tip-top now! TY!
[2021-03-07 21:22:37]
jaxscott - Posts: 57
I'd like to do something like this with changing the background/foreground colors of the countdown timer itself, rather than alter the bar colors. So for example when the Countdown timer on a 1 minute chart is less than 15 seconds, change to red background with white text. Possible?

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

Login

Login Page - Create Account