Login Page - Create Account

Support Board


Date/Time: Tue, 14 May 2024 19:36:57 +0000



Post From: Shortcut for Alert Requiring Multipe Prior Bars in MAX Formula

[2016-09-07 00:01:31]
Sawtooth - Posts: 3996
OK, the MAX function cannot do a range in Simple Alerts. (It works in spreadsheets, however.)
The : is the same as a , when used in Simple Alert formulas, so it is only comparing the current bar to the -19 bar, nothing in between.

Here is a workaround:
-Add the Highest High/Lowest Low Over N Bars study
-Set the Based On to the Volume study (or any study of interest)
-Set the Chart Region to the Volume study (or any study of interest)
-Set the length to 20
-Set the Input Data High to the desired subgraph

In the Color Bar study, reference the Highest High study with a formula like this:
=AND(ID2.SG1[-2]>ID2.SG1[-1],ID2.SG1>ID2.SG1[-1])
where ID2 is the Highest High study.

This will color the first price bar where the Volume is the highest in the last 20 bars.