Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 15:13:14 +0000



Condition alert for Vwap

View Count: 152

[2024-11-22 10:04:29]
fried4104 - Posts: 68
Hello,
I need to add a condition alert if the price is above vwap or the price is below vwap

I can use the Color Bar based on alert condition to put the the output if true to 1 but I don't know how to make the formula.
Lets say the vwap study is ID5 and vwap is SG1.
Can you please advise?
Thanks

LE: more context.
This is my current formula

AND(
CROSSFROMBELOW (C,ID3.SG1),
ID15.SG1 = 1,
ID17.SG1 = 1
)

I want to add to the above a condition if vwap above price, for example (ID5.SG1 = 1) but how to check that in a formula?
I searched but couldn't find.

LE2: solved added
C > ID5.SG1
respectively
C < ID5.SG1
for longs and shorts
Date Time Of Last Edit: 2024-11-22 11:28:42
[2024-11-22 11:56:47]
fried4104 - Posts: 68
I will expand on this, maybe someone could chime in.
How can I add time duration to this?
C > ID5.SG1

Is it possible to say - close has been higher than vwap (ID5.SG1) for let's say 10 minute?
I could add ticks, but I am stuck at time.
For ticks (at least 10 ticks) I add:
C - (10 * TICKSIZE) > ID16.SG1

I want this condition to weed out the chop candles within a tight range near vwap.

Thank you!
Date Time Of Last Edit: 2024-11-22 11:57:40
[2024-11-22 15:24:37]
John - SC Support - Posts: 37808
You can add the time component by checking a certain number of bars. For instance, to check if the Close is greater than ID5.SG1 for the last 3 bars you would have a condition that looks like the following:
=AND(C > ID5.SG1, C[-1] > ID5.SG1[-1], C[-2] > ID5.SG1[-2])

You would then need to add this to your already existing conditions using the AND() and/or OR() functions.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-22 16:18:49]
fried4104 - Posts: 68
Thanks for the reply @John,
If I wanted to use the above to confirm the last 30 min/bars, could I do that without a 30-long raw string formula?
Date Time Of Last Edit: 2024-11-22 16:19:24
[2024-11-22 19:12:15]
John - SC Support - Posts: 37808
The only way to get around writing a super-long Alert Formula would be to use another study as an intermediary. For instance, could use the Spreadsheet Study to do the testing over the number of bars (or you could use time in this case as the Spreadsheet Study has more support for testing times) for that particular item. Then have the result be a 0 (false) or 1 (true) coming out of the Spreadsheet Study. Then you can use that result in your formula as just 1 extra item such as:
=AND(ID1.SG1, ...)

Where ID1 is the ID of the Spreadsheet Study and SG1 is the subgraph of the column you use to hold the True/False result. Since the subgraph is a 0/1 you do not need to add any other tests to it, by having it stand alone that tells the system it is a boolean test for that object.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-11-22 20:46:38]
fried4104 - Posts: 68
Thanks John, seems complicated, will stick to your previous solution.
Thanks!

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

Login

Login Page - Create Account