Docs / Rule language
Rule language
Prices and offsets
O H L C V are the open, high, low, close and volume of the latest completed daily session. An offset in brackets walks back: C[-1] is yesterday's close.
| The bar | The latest completed session (refreshed after each close). During the trading day, rules see the previous session; a still-forming bar is never used. |
|---|---|
| History | About 1,500 daily sessions per symbol, adjusted for splits. |
| Offsets | Negative numbers look back: H[-2] is the high two sessions ago. A positive offset looks forward, and there is no next bar, so it answers 0.50. |
| Beyond price letters | Use ref(x, -n): ref(sma(C, 20), -5) is the 20-day average a week ago. |
Offsets on XLE
Session of 2026-10-30:
| Rule | Belief |
|---|---|
C > C[-1] | 0.9085 |
C[-1] > C[-2] | 0.6708 |
C > ref(C, -1) | 0.9085 |
C > C[-5] | 0.7066 |
C > C[1] | 0.5 |
sma(C, 20) > ref(sma(C, 20), -5) | 0.9425 |
C > C[-1] and C > ref(C, -1) are the same rule. C > C[1] sits on 0.50 because tomorrow does not exist yet.
Price functions
O H L C VOpen, high, low, close and volume of the bar being evaluated: the latest completed daily session. Prices are split- and dividend-adjusted.
C > OA green day. Every rule is about the latest bar unless you look back with an offset.C[-n] H[-n] L[-n] O[-n] V[-n]The same value n bars back. C[-1] is yesterday's close, H[-2] the high two sessions ago. Offsets work on the five price letters only; for anything else use ref().
C > C[-5]Higher than a week (five sessions) ago. A positive offset such as C[1] looks forward: there is no next bar, so it reads as "not known" (0.50).hl2()The middle of the bar: (H + L) / 2.
C > hl2()Closed in the upper half of the day's range.hlc3()The typical price: (H + L + C) / 3.
hlc3() > sma(hlc3(), 20)Typical price above its own 20-day average.ohlc4()The average of the four prices: (O + H + L + C) / 4.
ohlc4() > sma(C, 10)The day's average price is above the 10-day average close.tr()True range: the bar's high minus low, extended to include a gap from the previous close.
tr() > 1.5 * ref(atr(14), -1)Today's true range is half again yesterday's ATR: a wide day.Information, not investment advice. Beliefs and probabilities on this page are real responses for the session shown and change with every session.