Login Page - Create Account

Support Board


Date/Time: Sun, 02 Feb 2025 10:03:36 +0000



Post From: Question on Formula based on average of last 5 bars to be more than 1.2 times of usual

[2018-12-27 17:49:15]
John - SC Support - Posts: 37656
Hi Tom,

Yes, the formulas you are using would give different results, as the AVERAGE function in the Simple Alerts does not use the range in the same way as the Spreadsheet. In particular, the equation: =AVERAGE(ID5.SG1[0]:ID5.SG1[-5]) only returns the average of the 0th and -5th bar (just the two bars), not the range of the bars between them. Using this formula: =AVERAGE(ID5.SG1[0:-5]) will return the average of the range, or the average of all 6 bars (0, -1, -2, -3, -4, and -5).

Therefore, it is important to consider which method is being used to determine how to write the formula.

Also, with regards to the original formula giving a Syntax Error, that is due to the fact that there are some missing parentheses. I did not look that closely at the original, I was simply stating that the use of the range in the original post is the correct way to do it. In addition, there is no need to use the AND in the original, as there is no comparison between two (or more) items. Therefore the following would work:
=AVERAGE(ID5.SG1[0:-5])*1.2 > AVERAGE(ID5.SG1[-6:-20])
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing