DeMarker
The DeMarker compares the most recent maximum and minimum prices to assess the demand for an asset.
Role in the strategy
| Slot | Available | Role |
|---|---|---|
| Entry Point | No | — |
| Entry Rule | Yes | Filters entries by the DeMarker direction or its level position. |
| Exit Point | No | — |
| Exit Rule | Yes | Triggers exits by the DeMarker direction or its level position. |
The DeMarker 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 DeMarker value:
| Rule | Long signal is 1 when | Short signal is 1 when |
|---|---|---|
| DeMarker rises | DeMarker rose on the previous bar | DeMarker fell on the previous bar |
| DeMarker falls | DeMarker fell on the previous bar | DeMarker rose on the previous bar |
| DeMarker is higher than the Level line | DeMarker is above Level | DeMarker is below 1 − Level |
| DeMarker is lower than the Level line | DeMarker is below Level | DeMarker is above 1 − Level |
| DeMarker crosses the Level line upward | DeMarker crossed above Level from below | DeMarker crossed below 1 − Level from above |
| DeMarker crosses the Level line downward | DeMarker crossed below Level from above | DeMarker crossed above 1 − Level from below |
| DeMarker changes its direction upward | DeMarker formed a valley (down then up) | DeMarker formed a peak (up then down) |
| DeMarker changes its direction downward | DeMarker formed a peak (up then down) | DeMarker formed a valley (down then up) |
The Level parameter sets the long threshold; the short threshold is always 1 − Level. With the default Level of 0.3, the long side uses 0.3 and the short side uses 0.7.
Parameters
| Parameter | Type | Default | Range | Purpose |
|---|---|---|---|---|
| Period | number | 14 | 1 to 1000 | Bars over which the extremes are summed |
| Level | number | 0.3 | 0 to 1 | Long threshold; the short threshold is 1 − Level |
Calculation
tech.DeMarker in engine/indicator-engine/tech.ts computes:
- DeMax: positive increases of the high over the previous bar's high.
- DeMin: positive decreases of the previous bar's low under the current low.
- DeMarker =
SMA(DeMax) / (SMA(DeMax) + SMA(DeMin))over the Period.
The DeMarker line is drawn in a separate chart pane and always stays between 0 and 1.
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.