Williams' Percent Range
The WPR shows the position of the close price within the recent price range to identify overbought and oversold levels.
Role in the strategy
| Slot | Available | Role |
|---|---|---|
| Entry Point | No | — |
| Entry Rule | Yes | Filters entries by the WPR direction or its level position. |
| Exit Point | No | — |
| Exit Rule | Yes | Triggers exits by the WPR direction or its level position. |
The Williams' Percent Range produces conditions, not order prices. As an entry rule it is ANDed with the entry point and the other entry rules; as an exit rule it is ORed with the other exit rules. See Indicators for the slot semantics.
Logic rules
The indicator offers the standard oscillator rule set, evaluated on the WPR value, which moves between −100 and 0:
| Rule | Long signal is 1 when | Short signal is 1 when |
|---|---|---|
| WPR rises | WPR rose on the previous bar | WPR fell on the previous bar |
| WPR falls | WPR fell on the previous bar | WPR rose on the previous bar |
| WPR is higher than the Level line | WPR is above Level | WPR is below −100 − Level |
| WPR is lower than the Level line | WPR is below Level | WPR is above −100 − Level |
| WPR crosses the Level line upward | WPR crossed above Level from below | WPR crossed below −100 − Level from above |
| WPR crosses the Level line downward | WPR crossed below Level from above | WPR crossed above −100 − Level from below |
| WPR changes its direction upward | WPR formed a valley (down then up) | WPR formed a peak (up then down) |
| WPR changes its direction downward | WPR formed a peak (up then down) | WPR formed a valley (down then up) |
The Level parameter sets the long threshold; the short threshold is always −100 − Level. With the default Level of −20, the long side uses −20 and the short side uses −80.
Parameters
| Parameter | Type | Default | Range | Purpose |
|---|---|---|---|---|
| Period | number | 14 | 1 to 1000 | Bars of the price range |
| Level | number | −20 | −100 to 0 | Long threshold; the short threshold is −100 − Level |
Calculation
tech.WPR in engine/indicator-engine/tech.ts computes WPR = −100 × (Highest High − Close) / (Highest High − Lowest Low) over the Period. The line is drawn in a separate chart pane; values near 0 mark strength, values near −100 mark oversold conditions.
Backtesting
- The rule is evaluated on the previous (closed) bar with the standard dead zone (
SIGMA = 0.000001). - The indicator contributes only long/short signal arrays — it never changes the entry or exit order price.
- An entry happens only when the entry point allows the direction and every entry rule passes; an exit happens when the exit point is reached and any exit rule passes.