rungfolio

The moving-average pause

safety.moving-average

What 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".

Worked example: the safety net at a close of 82.05
CheckSettingResultRule
Moving average150-day average of 75.00Clearsafety.moving-average
FloorNot setNot setsafety.floor
Capital cap50% of $50,000.00: $25,000.00$25,000.00 of room before tonight's buyssafety.capital-cap
BudgetNot setNot setsafety.budget
StatusBuying onsafety.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.

Worked example: the safety net at a close of 82.05, with a 150-day average of 82.05
CheckSettingResultRule
Moving average150-day average of 82.05Clearsafety.moving-average
FloorNot setNot setsafety.floor
Capital cap50% of $50,000.00: $25,000.00$25,000.00 of room before tonight's buyssafety.capital-cap
BudgetNot setNot setsafety.budget
StatusBuying onsafety.pause

Last, the average is 82.50, above the close. The row is tripped, and the status changes to "Paused".

Worked example: the safety net at a close of 82.05, with a 150-day average of 82.50
CheckSettingResultRule
Moving average150-day average of 82.50Trippedsafety.moving-average
FloorNot setNot setsafety.floor
Capital cap50% of $50,000.00: $25,000.00$25,000.00 of room before tonight's buyssafety.capital-cap
BudgetNot setNot setsafety.budget
StatusPausedsafety.pause
Paused150-day average 82.50close 82.05CAPITAL CAP$0.00 in use of $25,000.00
Worked example: the safety net at a close of 82.05. The shaded band is where buying pauses: below the average, and below a floor if one is set.

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.

Educational software, not investment advice.