rungfolio

The taper solver

taper.solver

What it does

The taper solver picks the largest taper that keeps the whole ladder, from the top down to the moving average, within your capital limit. It solves for either the starting size or the step. The moving average is a long-term average of the closing price (the moving-average pause explains it).

How it works

It takes every rung from the top down to the first rung whose buy limit is at or below the moving average. The top is the one taper sizing counts its steps from: the starting price, or, when the Top setting chooses it, the six-month high if that is higher. It adds up what they would cost if every one filled: each buy limit times its shares.

The limit is the smaller of two amounts:

So the result matches what tonight's plan will actually arm.

You choose what to solve for: the starting size, with the step fixed, or the step, with the start fixed. The answer is at most 1,000,000 shares, the largest the settings allow. The cost rises in a straight line with either one, at least until a rung reaches the 100,000,000-share maximum, so the solver works out the largest whole number directly, rather than by trial.

It then carries the same sizing on below the average, to find the cap price. That is the buy limit of the deepest rung whose running cost, the total so far from the top, still fits the limit. It shows the cap price beside the average. When the solver finds a value, the rungs down to the average fit by design, so the cap price is never above the average. If the whole ladder, down to its bottom, fits the limit, the cap is never reached.

Why pair the taper with the average? Buying pauses below it (the moving-average pause), so sizing the ladder to reach its limit near the average puts the capital to work above that point.

When it can't solve

There are three cases, and each gets its own message instead of a result:

  • even the smallest taper, a start of 1 share or a step of 0, costs more than the limit;
  • the moving average isn't below the top;
  • when solving for the step, the ladder reaches the average before the first step applies.

Examples

This solves for the starting size, with 1 more share every 4 rungs, for the example account and a moving average of 75.00. Look at the solved size in the last line, the table that runs down to the average, and the cap price, which sits below the average.

Worked example: taper sizing down to a moving average of 75.00
RungBuy limitSharesCostRunning sharesRunning cost
082.373$247.113$247.11
182.163$246.486$493.59
281.953$245.859$739.44
381.753$245.2512$984.69
481.544$326.1616$1,310.85
581.344$325.3620$1,636.21
681.144$324.5624$1,960.77
780.934$323.7228$2,284.49
880.735$403.6533$2,688.14
980.535$402.6538$3,090.79
1080.335$401.6543$3,492.44
1180.135$400.6548$3,893.09
1279.936$479.5854$4,372.67
1379.736$478.3860$4,851.05
1479.536$477.1866$5,328.23
1579.336$475.9872$5,804.21
1679.137$553.9179$6,358.12
1778.937$552.5186$6,910.63
1878.747$551.1893$7,461.81
1978.547$549.78100$8,011.59
2078.348$626.72108$8,638.31
2178.158$625.20116$9,263.51
2277.958$623.60124$9,887.11
2377.768$622.08132$10,509.19
2477.569$698.04141$11,207.23
2577.379$696.33150$11,903.56
2677.179$694.53159$12,598.09
2776.989$692.82168$13,290.91
2876.7910$767.90178$14,058.81
2976.6010$766.00188$14,824.81
3076.4110$764.10198$15,588.91
3176.2210$762.20208$16,351.11
3276.0211$836.22219$17,187.33
3375.8311$834.13230$18,021.46
3475.6411$832.04241$18,853.50
3575.4611$830.06252$19,683.56
3675.2712$903.24264$20,586.80
3775.0812$900.96276$21,487.76
3874.8912$898.68288$22,386.44
Start: 3 shares, plus 1 share for each 4-rung step. Limit: $25,000.00. Cap price: 74.52. Rule: taper.solver

Now the solver finds the step instead, from a 1-share start with a step every 8 rungs. The last line shows the step it found and its cap price.

Worked example: taper sizing down to a moving average of 75.00, with 8-rung steps, solving for the step
RungBuy limitSharesCostRunning sharesRunning cost
082.371$82.371$82.37
182.161$82.162$164.53
281.951$81.953$246.48
381.751$81.754$328.23
481.541$81.545$409.77
581.341$81.346$491.11
681.141$81.147$572.25
780.931$80.938$653.18
880.734$322.9212$976.10
980.534$322.1216$1,298.22
1080.334$321.3220$1,619.54
1180.134$320.5224$1,940.06
1279.934$319.7228$2,259.78
1379.734$318.9232$2,578.70
1479.534$318.1236$2,896.82
1579.334$317.3240$3,214.14
1679.137$553.9147$3,768.05
1778.937$552.5154$4,320.56
1878.747$551.1861$4,871.74
1978.547$549.7868$5,421.52
2078.347$548.3875$5,969.90
2178.157$547.0582$6,516.95
2277.957$545.6589$7,062.60
2377.767$544.3296$7,606.92
2477.5610$775.60106$8,382.52
2577.3710$773.70116$9,156.22
2677.1710$771.70126$9,927.92
2776.9810$769.80136$10,697.72
2876.7910$767.90146$11,465.62
2976.6010$766.00156$12,231.62
3076.4110$764.10166$12,995.72
3176.2210$762.20176$13,757.92
3276.0213$988.26189$14,746.18
3375.8313$985.79202$15,731.97
3475.6413$983.32215$16,715.29
3575.4613$980.98228$17,696.27
3675.2713$978.51241$18,674.78
3775.0813$976.04254$19,650.82
3874.8913$973.57267$20,624.39
Start: 1 share, plus 3 shares for each 8-rung step. Limit: $25,000.00. Cap price: 74.33. Rule: taper.solver

Last, the first example again, tapering from a six-month high of 84.45, above the start. The table now starts at a rung above the start, and every rung counts its steps from there, so the same limit has to cover more rungs and more steps, and the solved start is smaller.

Worked example: taper sizing down to a moving average of 75.00, tapering from a top of 84.45
RungBuy limitSharesCostRunning sharesRunning cost
−984.241$84.241$84.24
−884.031$84.032$168.27
−783.821$83.823$252.09
−683.611$83.614$335.70
−583.402$166.806$502.50
−483.192$166.388$668.88
−382.992$165.9810$834.86
−282.782$165.5612$1,000.42
−182.573$247.7115$1,248.13
082.373$247.1118$1,495.24
182.163$246.4821$1,741.72
281.953$245.8524$1,987.57
381.754$327.0028$2,314.57
481.544$326.1632$2,640.73
581.344$325.3636$2,966.09
681.144$324.5640$3,290.65
780.935$404.6545$3,695.30
880.735$403.6550$4,098.95
980.535$402.6555$4,501.60
1080.335$401.6560$4,903.25
1180.136$480.7866$5,384.03
1279.936$479.5872$5,863.61
1379.736$478.3878$6,341.99
1479.536$477.1884$6,819.17
1579.337$555.3191$7,374.48
1679.137$553.9198$7,928.39
1778.937$552.51105$8,480.90
1878.747$551.18112$9,032.08
1978.548$628.32120$9,660.40
2078.348$626.72128$10,287.12
2178.158$625.20136$10,912.32
2277.958$623.60144$11,535.92
2377.769$699.84153$12,235.76
2477.569$698.04162$12,933.80
2577.379$696.33171$13,630.13
2677.179$694.53180$14,324.66
2776.9810$769.80190$15,094.46
2876.7910$767.90200$15,862.36
2976.6010$766.00210$16,628.36
3076.4110$764.10220$17,392.46
3176.2211$838.42231$18,230.88
3276.0211$836.22242$19,067.10
3375.8311$834.13253$19,901.23
3475.6411$832.04264$20,733.27
3575.4612$905.52276$21,638.79
3675.2712$903.24288$22,542.03
3775.0812$900.96300$23,442.99
3874.8912$898.68312$24,341.67
Start: 1 share, plus 1 share for each 4-rung step. Limit: $25,000.00. Cap price: 74.89. Rule: taper.solver

In the app

With taper sizing, Edit settings has a "Solve" button. It fills in the solved value and shows its cap price against the average.

Educational software, not investment advice.