Login Page - Create Account

Support Board


Date/Time: Mon, 13 Jan 2025 05:52:55 +0000



Post From: Swing High/Low alert issue

[2017-03-31 15:46:48]
User32668 - Posts: 5
The swing high/low alert code is given on http://www.sierrachart.com/index.php?page=doc/StudyChartAlertsAndScanning.php#FormulaExamples item 27 as:

=OR(SG1 > 0, SG2 > 0, SG0[-1] > 0, SG1[-1] > 0, SG0[-2] > 0, SG1[-2] > 0, SG0[-3] > 0, SG1[-3] > 0)

It says this should alert for all swing highs and lows as printed for a length of 2. However unfortunately the code above only alerts for swing highs. I rewrote it as below:

=OR(SG1 > 0, SG2 > 0, SG1[-1] > 0, SG2[-1] > 0, SG1[-2] > 0, SG2[-2] > 0, SG1[-3] > 0, SG2[-3] > 0)

This mostly works but probably misses about 25% of swing lows on backtesting - it never misses a swing high - can someone please assist where I might be going wrong?

Thanks.