Login Page - Create Account

Support Board


Date/Time: Mon, 08 Sep 2025 21:06:35 +0000



Post From: Issue using AVERAGE function to compare delta to previous values

[2025-08-12 12:06:15]
LongShortz - Posts: 21
Okay hopefully I can ask this clearly. I'm having trouble writing an alert using the AVERAGE function. I'm not using a spreadsheet for this. Just using logic in the 'Color Bar By Alert Condition' study. What I'm looking for is to run a comparison of the delta on the current candle (SG1 on the Numbers Bars Calculated Values) to the average delta on the previous 4 candles. The goal is to identify where strong opposition is entering the market for a reversal setup. So for the portion of the logic pertaining to this, I used the below.

=AND(ID5.SG1 < (=AVERAGE(ID5.SG1[-1:-4]) * -2)

I believe this says: The current delta must be less than the average of the previous 4 candles delta times negative 2.

There are other criteria in the overall formula but I've proven those to work already. But just to be safe, I removed all other portions of the formula leaving only the above and it still did not work. To be clear, if the alert fired successfully, it would be highlighted in a white outline.

Image uploaded. https://www.sierrachart.com/image.php?Image=1755000120869.png