Login Page - Create Account

Support Board


Date/Time: Sun, 02 Jun 2024 06:06:54 +0000



[Programming Help] - Logic for calculating an average of only specific bars

View Count: 442

[2021-08-18 17:06:30]
BenjFlame - Posts: 308
Hi,
what's the general logic for calculating an average but only of bars that meet a special condition?
Say I want to calculate average range of only up bars (Close > Open).

I could create an intermediate subgraph with fabs(Open - Close), but won't there be gaps in the subgraph? How to handle this situation?
[2021-08-18 18:12:00]
Sawtooth - Posts: 4019
This spreadsheet example could be modified to do what you want:
Spreadsheet Example Formulas and Usage: Simple Moving Average - Skip Zeros

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

Login

Login Page - Create Account