The moving-average pause
safety.moving-averageWhat it does
Buying pauses while the price closes below its long-term average. By default, that average is the 150-day simple moving average.
How it works
A close is a day's closing price. A simple average is the plain kind: add up the closes over the set number of days, then divide by that number. Each night, when Rungfolio plans the next day's orders, it compares the last close with this average.
A close below the average pauses the ladder. Its buys are canceled, and its sells keep working (what a pause does has the details). A close at or above the average means buying is on. A close exactly at the average counts as clear.
The check has no memory of earlier nights. It looks only at tonight's close and average, so the first close back at or above the average turns buying on again.
The average uses closes adjusted for stock splits, and it never looks ahead: it leaves out any day after the one being checked. It is rounded half up to 4 decimal places, and that rounded value is both the one shown and the one the close is compared with. The new-ladder preview works it out from the ticker's daily prices, for the number of days you set.
The reason for the rule is this. In a long decline, a ladder would keep buying rung after rung. Pausing below the long-term average limits how much it buys while the price trends down.
The price floor is checked alongside this rule, and either one pauses the ladder. The taper solver sizes the ladder toward this same average.
Examples
In this first example, the close is above the average. The moving-average row is clear, and the status reads "Buying on".
| Check | Setting | Result | Rule |
|---|---|---|---|
| Moving average | 150-day average of 75.00 | Clear | safety.moving-average |
| Floor | Not set | Not set | safety.floor |
| Capital cap | 50% of $50,000.00: $25,000.00 | $25,000.00 of room before tonight's buys | safety.capital-cap |
| Budget | Not set | Not set | safety.budget |
| Status | Buying on | safety.pause | |
Next, the average sits exactly at the close, at 82.05. The row is still clear, because a close at the average counts as clear.
| Check | Setting | Result | Rule |
|---|---|---|---|
| Moving average | 150-day average of 82.05 | Clear | safety.moving-average |
| Floor | Not set | Not set | safety.floor |
| Capital cap | 50% of $50,000.00: $25,000.00 | $25,000.00 of room before tonight's buys | safety.capital-cap |
| Budget | Not set | Not set | safety.budget |
| Status | Buying on | safety.pause | |
Last, the average is 82.50, above the close. The row is tripped, and the status changes to "Paused".
| Check | Setting | Result | Rule |
|---|---|---|---|
| Moving average | 150-day average of 82.50 | Tripped | safety.moving-average |
| Floor | Not set | Not set | safety.floor |
| Capital cap | 50% of $50,000.00: $25,000.00 | $25,000.00 of room before tonight's buys | safety.capital-cap |
| Budget | Not set | Not set | safety.budget |
| Status | Paused | safety.pause | |
Settings
The pause is on by default, over 150 days. The number of days can be from 2 to 400. You can also turn the rule off.
In the app
The new-ladder preview's status strip reads "Buying on" or "Paused", in words, with this rule's sentence and a "why?" button.