Calculation guide
Start at the first observation. Update the running high for longs or low for shorts. A crossing fills at the observed trade price, including any gap. No intraperiod prices assumed.
Long trigger = running high × (1 − trail). Short trigger = running low × (1 + trail).
Inputs
Trailing distance
Example entry 5 %. Allowed range 0 to 100.
Order side
Select one of the listed cases (Buy / Sell).
Price per unit
Example entry 100 (in the selected currency). Minimum 1e-08.
Worked example
| Input | Value |
|---|---|
| Trailing distance | 5% |
| Order side | Buy |
Observed trade prices in time order
| Price per unit |
|---|
| 100 |
| 110 |
| 103 |
| 98 |
| Result | Value |
|---|---|
| Last trigger level | 104.5 |
| Simulated exit price | 103 |
| Exit observation number | 3 |
How each input affects this example
Each row starts from the worked example and changes one input.
| Input | Original input | New input | Affected result | Original result | New result |
|---|---|---|---|---|---|
| Trailing distance | 5% | 6% | Last trigger level | 104.5 | 103.4 |
| Order side | Buy | Sell | Last trigger level | 104.5 | 105 |
| Price per unit (row 2) | 110 | 121 | Last trigger level | 104.5 | 114.95 |
