Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 14:04:21 +0000



[Programming Help] - Alert formula (Compare current bar with past X bars)

View Count: 1967

[2019-08-26 11:23:45]
User383849 - Posts: 23
Hi! I want a formula to alert me when I get a huge volume candle that's 5x bigger than the past 20 bars.

Is there a shorter way / simpler function or I need to use the AND operator and compare the current bar with previous bars 20 times like this:

AND(SG1[0] > SG1[-1]*5,
SG1[0] > SG1[-2]*5,
SG1[0] > SG1[-3]*5,
.
.
.
SG1[0] > SG1[-20]*5)

Thanks! :)
[2019-08-26 22:48:38]
Ackin - Posts: 1865
Hi,
another way: the condition can also be met by comparing the second largest volume in the range. How to do it in alert but I do not know (there is no loop possible). ACSIL or spreadsheet.

you can download ACSIL study for free from our CZ/SK forum
(just Study in dll file, not code).

Study name: Compare Huge volume
- ask alert
- bid alert
- vol alert
- ratio ticksize alert



contact link:
https://www.sierrachart.com/UserControlPanel.php?page=StudyStore&SCDLLName=zyp_download_free
Date Time Of Last Edit: 2020-06-24 22:33:14
[2019-08-26 23:29:19]
Sawtooth - Posts: 3976
Try this:
=V>MAX(V[-1:-20])*5

Here's the documentation:
Study/Chart Alerts And Scanning: Referencing A Range of Data
[2019-08-26 23:38:46]
Ackin - Posts: 1865
tomgilb)
Nice ...
[2019-08-27 07:33:44]
User383849 - Posts: 23
tomgilb, it works. Simple and elegant. Thanks!
Ackin, thanks for helping out as well!
Date Time Of Last Edit: 2019-08-27 07:34:25

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

Login

Login Page - Create Account