Login Page - Create Account

Support Board


Date/Time: Fri, 29 Mar 2024 07:33:51 +0000



[Programming Help] - Color Bar Based on Alert Condition partially NOT WORKING w/ Swing High/Low study

View Count: 1519

[2018-06-13 23:30:32]
BenjaminR - Posts: 168
Using a "Number of Trades" bar period of 500.
Donchian Channel period: 20
The alerts are performed using two "Color Bar Based on Alert Condition" studies.

ID1.SG1 = Swing High/Low Study (swing high)
ID1.SG2 = "" "" (swing low)
ID2.SG3 = Donchian Channel Study midline


ID1.SG2>ID2.SG3 alert for a Swing Low above the midline of Donchian Channel - works perfectly.

ID1.SG1<ID2.SG3 alert for a Swing High below the midline of Donchian Channel - does not work.

I also tried reversing the formula, i.e, ID2.SG3>ID1.SG1 to no avail.

In the chart image provided, the RED & GREEN ARROWS are the stock Swing High/Low Study arrows.

The BLUE UP TRIANGLE is a positive alert for ID1.SG2>ID2.SG3, where the Swing Low is above the midline of the Donchian Channel. Notice that there is NO BLUE UP TRIANGLE under any Swing Lows BELOW the midling of Donchian Channel, nor are there any BLUE UP TRIANGLES under any other bar.

The PINK DOWN TRIANGLE is a positive alert for ID1.SG1<ID2.SG3. Notice that the alert is being triggered for EVERY bar, EXCEPT the Swing Highs above the midline of the Donchian Channel.

The inverse alert formulae should both perform exactly the same, respectively.

Please advise.

Thank you

http://www.sierrachart.com/image.php?Image=1528932530663.png
Date Time Of Last Edit: 2018-06-14 02:47:42
[2018-06-13 23:59:11]
Sawtooth - Posts: 3952
This is because the Swing High is zero when it's not a new high, and zero is always less than the Donchian mid line.
This doesn't affect the Swing Low's relationship to the Donchian mid line because zero is always less than the Donchian mid line.

For the Swing High below the Donchian mid line, use this formula instead:
=AND(ID1.SG1<ID2.SG3,ID1.SG1<>0)
[2018-06-14 00:07:32]
BenjaminR - Posts: 168
tomgilb:

You sir, are a gentleman & a scholar.

Got it!!! Thank you so much. I will use that in troubleshooting other situations with other studies that might function in a similar way.

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

Login

Login Page - Create Account