Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 17:52:16 +0000



Super Trend Stop alert

View Count: 506

[2022-10-30 08:53:35]
DKtrades - Posts: 33
Hello, I am trying to write a formula so I can have a visual alert when the Super Trend Stop flips from above the current candle to below (and vice versa).

I have tried using a Color Background Based On Alert Condition where the value of the Super Trend Stop is compared to the Current Price Line.

But that doesn't achieve what I wish to see.

One (not preferred) option would be that I would like either a Color Bar Based On Alert Condition -- that has a different colored bar when the Super Trend Stop "flips" (and I can either have two of these, one for flipping "above" and one for flipping "below" -- or to have both in one study).

Even better, like with the MACD Crossover System, I would like an arrow that appears on the first candle when the Super Trend Stop flips.

I don't know the formula though to do this -- my basic comparison of the Current Price and Super Trend Stop value hasn't worked as it applies the current price to all previous candles, not just the current candle.

Any help would be appreciated -- would be great to have an alert for this (and then I can link it to an audio alert too).

I have searched here, and on Google, and in the documentation, but the formula eludes me.

Thank you.
[2022-10-30 12:46:10]
Sawtooth - Posts: 3992
I don't know the formula though to do this
Use two instances of the Color Bar Based On Alert Condition study, with formulas like these on the Alerts tab:
Flip to uptrend:
=AND(ID1.SG1[-1]>=C[-2],ID1.SG1<L)
Flip to downtrend:
=AND(ID1.SG1[-1]<=C[-2],ID1.SG1>H)
where ID1 is the SuperTrend Stop study

These formulas will only produce a T/F, so in Color Bar studies, you're limited to markers that do not require a placement price, like:
Color Bar
Color Background
Point on Low
Point on High

If you want arrows or triangles, etc.:
Use two instances of the Spreadsheet Formula study to return placement prices, with formulas like these in the Formula field:
Flip to uptrend:
=IF(AND(ID1.SG1[-1]>=C[-2],ID1.SG1<L),L,0)
Flip to downtrend:
=IF(AND(ID1.SG1[-1]<=C[-2],ID1.SG1>H),H,0)
where ID1 is the SuperTrend Stop study
Also:
- Set the Chart Region to 1.
- Set 'Draw Zero Values' to No.
[2022-10-31 00:56:59]
DKtrades - Posts: 33
Thanks tomgilb, that's very much appreciated!

The more I use Sierra Chart, the more I like the power of what can be achieved -- and appreciate the guidance.

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

Login

Login Page - Create Account