The taper solver
taper.solverWhat 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:
- the room under the capital cap: the cap, less the capital already in use elsewhere in the account;
- the ladder budget, if one is set.
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.
| Rung | Buy limit | Shares | Cost | Running shares | Running cost |
|---|---|---|---|---|---|
| 0 | 82.37 | 3 | $247.11 | 3 | $247.11 |
| 1 | 82.16 | 3 | $246.48 | 6 | $493.59 |
| 2 | 81.95 | 3 | $245.85 | 9 | $739.44 |
| 3 | 81.75 | 3 | $245.25 | 12 | $984.69 |
| 4 | 81.54 | 4 | $326.16 | 16 | $1,310.85 |
| 5 | 81.34 | 4 | $325.36 | 20 | $1,636.21 |
| 6 | 81.14 | 4 | $324.56 | 24 | $1,960.77 |
| 7 | 80.93 | 4 | $323.72 | 28 | $2,284.49 |
| 8 | 80.73 | 5 | $403.65 | 33 | $2,688.14 |
| 9 | 80.53 | 5 | $402.65 | 38 | $3,090.79 |
| 10 | 80.33 | 5 | $401.65 | 43 | $3,492.44 |
| 11 | 80.13 | 5 | $400.65 | 48 | $3,893.09 |
| 12 | 79.93 | 6 | $479.58 | 54 | $4,372.67 |
| 13 | 79.73 | 6 | $478.38 | 60 | $4,851.05 |
| 14 | 79.53 | 6 | $477.18 | 66 | $5,328.23 |
| 15 | 79.33 | 6 | $475.98 | 72 | $5,804.21 |
| 16 | 79.13 | 7 | $553.91 | 79 | $6,358.12 |
| 17 | 78.93 | 7 | $552.51 | 86 | $6,910.63 |
| 18 | 78.74 | 7 | $551.18 | 93 | $7,461.81 |
| 19 | 78.54 | 7 | $549.78 | 100 | $8,011.59 |
| 20 | 78.34 | 8 | $626.72 | 108 | $8,638.31 |
| 21 | 78.15 | 8 | $625.20 | 116 | $9,263.51 |
| 22 | 77.95 | 8 | $623.60 | 124 | $9,887.11 |
| 23 | 77.76 | 8 | $622.08 | 132 | $10,509.19 |
| 24 | 77.56 | 9 | $698.04 | 141 | $11,207.23 |
| 25 | 77.37 | 9 | $696.33 | 150 | $11,903.56 |
| 26 | 77.17 | 9 | $694.53 | 159 | $12,598.09 |
| 27 | 76.98 | 9 | $692.82 | 168 | $13,290.91 |
| 28 | 76.79 | 10 | $767.90 | 178 | $14,058.81 |
| 29 | 76.60 | 10 | $766.00 | 188 | $14,824.81 |
| 30 | 76.41 | 10 | $764.10 | 198 | $15,588.91 |
| 31 | 76.22 | 10 | $762.20 | 208 | $16,351.11 |
| 32 | 76.02 | 11 | $836.22 | 219 | $17,187.33 |
| 33 | 75.83 | 11 | $834.13 | 230 | $18,021.46 |
| 34 | 75.64 | 11 | $832.04 | 241 | $18,853.50 |
| 35 | 75.46 | 11 | $830.06 | 252 | $19,683.56 |
| 36 | 75.27 | 12 | $903.24 | 264 | $20,586.80 |
| 37 | 75.08 | 12 | $900.96 | 276 | $21,487.76 |
| 38 | 74.89 | 12 | $898.68 | 288 | $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.
| Rung | Buy limit | Shares | Cost | Running shares | Running cost |
|---|---|---|---|---|---|
| 0 | 82.37 | 1 | $82.37 | 1 | $82.37 |
| 1 | 82.16 | 1 | $82.16 | 2 | $164.53 |
| 2 | 81.95 | 1 | $81.95 | 3 | $246.48 |
| 3 | 81.75 | 1 | $81.75 | 4 | $328.23 |
| 4 | 81.54 | 1 | $81.54 | 5 | $409.77 |
| 5 | 81.34 | 1 | $81.34 | 6 | $491.11 |
| 6 | 81.14 | 1 | $81.14 | 7 | $572.25 |
| 7 | 80.93 | 1 | $80.93 | 8 | $653.18 |
| 8 | 80.73 | 4 | $322.92 | 12 | $976.10 |
| 9 | 80.53 | 4 | $322.12 | 16 | $1,298.22 |
| 10 | 80.33 | 4 | $321.32 | 20 | $1,619.54 |
| 11 | 80.13 | 4 | $320.52 | 24 | $1,940.06 |
| 12 | 79.93 | 4 | $319.72 | 28 | $2,259.78 |
| 13 | 79.73 | 4 | $318.92 | 32 | $2,578.70 |
| 14 | 79.53 | 4 | $318.12 | 36 | $2,896.82 |
| 15 | 79.33 | 4 | $317.32 | 40 | $3,214.14 |
| 16 | 79.13 | 7 | $553.91 | 47 | $3,768.05 |
| 17 | 78.93 | 7 | $552.51 | 54 | $4,320.56 |
| 18 | 78.74 | 7 | $551.18 | 61 | $4,871.74 |
| 19 | 78.54 | 7 | $549.78 | 68 | $5,421.52 |
| 20 | 78.34 | 7 | $548.38 | 75 | $5,969.90 |
| 21 | 78.15 | 7 | $547.05 | 82 | $6,516.95 |
| 22 | 77.95 | 7 | $545.65 | 89 | $7,062.60 |
| 23 | 77.76 | 7 | $544.32 | 96 | $7,606.92 |
| 24 | 77.56 | 10 | $775.60 | 106 | $8,382.52 |
| 25 | 77.37 | 10 | $773.70 | 116 | $9,156.22 |
| 26 | 77.17 | 10 | $771.70 | 126 | $9,927.92 |
| 27 | 76.98 | 10 | $769.80 | 136 | $10,697.72 |
| 28 | 76.79 | 10 | $767.90 | 146 | $11,465.62 |
| 29 | 76.60 | 10 | $766.00 | 156 | $12,231.62 |
| 30 | 76.41 | 10 | $764.10 | 166 | $12,995.72 |
| 31 | 76.22 | 10 | $762.20 | 176 | $13,757.92 |
| 32 | 76.02 | 13 | $988.26 | 189 | $14,746.18 |
| 33 | 75.83 | 13 | $985.79 | 202 | $15,731.97 |
| 34 | 75.64 | 13 | $983.32 | 215 | $16,715.29 |
| 35 | 75.46 | 13 | $980.98 | 228 | $17,696.27 |
| 36 | 75.27 | 13 | $978.51 | 241 | $18,674.78 |
| 37 | 75.08 | 13 | $976.04 | 254 | $19,650.82 |
| 38 | 74.89 | 13 | $973.57 | 267 | $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.
| Rung | Buy limit | Shares | Cost | Running shares | Running cost |
|---|---|---|---|---|---|
| −9 | 84.24 | 1 | $84.24 | 1 | $84.24 |
| −8 | 84.03 | 1 | $84.03 | 2 | $168.27 |
| −7 | 83.82 | 1 | $83.82 | 3 | $252.09 |
| −6 | 83.61 | 1 | $83.61 | 4 | $335.70 |
| −5 | 83.40 | 2 | $166.80 | 6 | $502.50 |
| −4 | 83.19 | 2 | $166.38 | 8 | $668.88 |
| −3 | 82.99 | 2 | $165.98 | 10 | $834.86 |
| −2 | 82.78 | 2 | $165.56 | 12 | $1,000.42 |
| −1 | 82.57 | 3 | $247.71 | 15 | $1,248.13 |
| 0 | 82.37 | 3 | $247.11 | 18 | $1,495.24 |
| 1 | 82.16 | 3 | $246.48 | 21 | $1,741.72 |
| 2 | 81.95 | 3 | $245.85 | 24 | $1,987.57 |
| 3 | 81.75 | 4 | $327.00 | 28 | $2,314.57 |
| 4 | 81.54 | 4 | $326.16 | 32 | $2,640.73 |
| 5 | 81.34 | 4 | $325.36 | 36 | $2,966.09 |
| 6 | 81.14 | 4 | $324.56 | 40 | $3,290.65 |
| 7 | 80.93 | 5 | $404.65 | 45 | $3,695.30 |
| 8 | 80.73 | 5 | $403.65 | 50 | $4,098.95 |
| 9 | 80.53 | 5 | $402.65 | 55 | $4,501.60 |
| 10 | 80.33 | 5 | $401.65 | 60 | $4,903.25 |
| 11 | 80.13 | 6 | $480.78 | 66 | $5,384.03 |
| 12 | 79.93 | 6 | $479.58 | 72 | $5,863.61 |
| 13 | 79.73 | 6 | $478.38 | 78 | $6,341.99 |
| 14 | 79.53 | 6 | $477.18 | 84 | $6,819.17 |
| 15 | 79.33 | 7 | $555.31 | 91 | $7,374.48 |
| 16 | 79.13 | 7 | $553.91 | 98 | $7,928.39 |
| 17 | 78.93 | 7 | $552.51 | 105 | $8,480.90 |
| 18 | 78.74 | 7 | $551.18 | 112 | $9,032.08 |
| 19 | 78.54 | 8 | $628.32 | 120 | $9,660.40 |
| 20 | 78.34 | 8 | $626.72 | 128 | $10,287.12 |
| 21 | 78.15 | 8 | $625.20 | 136 | $10,912.32 |
| 22 | 77.95 | 8 | $623.60 | 144 | $11,535.92 |
| 23 | 77.76 | 9 | $699.84 | 153 | $12,235.76 |
| 24 | 77.56 | 9 | $698.04 | 162 | $12,933.80 |
| 25 | 77.37 | 9 | $696.33 | 171 | $13,630.13 |
| 26 | 77.17 | 9 | $694.53 | 180 | $14,324.66 |
| 27 | 76.98 | 10 | $769.80 | 190 | $15,094.46 |
| 28 | 76.79 | 10 | $767.90 | 200 | $15,862.36 |
| 29 | 76.60 | 10 | $766.00 | 210 | $16,628.36 |
| 30 | 76.41 | 10 | $764.10 | 220 | $17,392.46 |
| 31 | 76.22 | 11 | $838.42 | 231 | $18,230.88 |
| 32 | 76.02 | 11 | $836.22 | 242 | $19,067.10 |
| 33 | 75.83 | 11 | $834.13 | 253 | $19,901.23 |
| 34 | 75.64 | 11 | $832.04 | 264 | $20,733.27 |
| 35 | 75.46 | 12 | $905.52 | 276 | $21,638.79 |
| 36 | 75.27 | 12 | $903.24 | 288 | $22,542.03 |
| 37 | 75.08 | 12 | $900.96 | 300 | $23,442.99 |
| 38 | 74.89 | 12 | $898.68 | 312 | $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.