Support Board
Date/Time: Fri, 14 Mar 2025 18:08:02 +0000
CBBOAC Formula - Average of Time
View Count: 532
[2022-06-24 03:32:24] |
SavantTrader - Posts: 110 |
Within a CBBOAC, I am wanting to take an average of the last 3 values of the [Numbers Bars Calculated Values][Bar Duration](SG30) and compare it to the current value of [Bar Duration](SG30). However, due to the fact that (obviously) Bar Duration is expressed as time, I'm not able to compare the "average" to anything. Can someone tell me how I can take the average of a time value [Bar Duration] and compare it against the current bar's duration (plus 60%)? For example, I am able to do this for other things, such as ATR: IDx.SG1>IDy.SG1*1.6 (where x=ATR study, y=EMA of ATR) This asks "is the current bar ATR greater than 160% of the EMA (over whatever period the EMA study is set for)" I would like to do the above with [Bar Duration] but the comparison becomes meaningless. Is there a way to accomplish the above using only a CBBOAC formula? I can compare durations to a constant by doing this: IDx.SG1>TIMEVALUE("00:02:01"), However, instead of a constant, I'd like to compare it to the EMA of the time values. If this is still unclear, how can I do this (which fails due to illegal comparison): IDx.SG1>IDy.SG1*1.6 where x=bar duration, y=EMA of bar duration. Thank you... any tips or hints appreciated. I'm stuck on this one. Date Time Of Last Edit: 2022-06-24 07:00:35
|
[2022-06-24 13:25:58] |
John - SC Support - Posts: 38669 |
Start by referring to the last paragraph of this section: Numbers Bars: Referencing Numbers Bars Calculated Values Subgraphs in Alert Formulas Then click the link for serial date/time in that paragraph to understand how time is stored in Sierra Chart. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: