RSI, stochastic %K and PPO: three oscillators on one crash

On this page
  1. RSI: the average up-day against the average down-day
  2. Stochastic %K: where today’s close sits in the recent range
  3. PPO: the gap between two averages, in percent
  4. Three readings of one crash
  5. Traps
  6. The code
  7. Summary
  8. References

The Bollinger Bands post and the SMA cross post drew their lines on the price chart, in dollars. The three indicators here live in a panel of their own, on a scale that never changes: 0 to 100 for the first two, a percentage around zero for the third. Murphy names the two problems that scale solves. A plain momentum line (today’s price minus the price ten days ago) jumps when a big day falls out of the back of the window even if today is quiet, and it has no fixed range, so “high” on one stock is nothing on another. An oscillator is an indicator built to fix both: smoothed, and bounded. Kirkpatrick and Dahlquist define the family more tightly: an oscillator is calculated from two moving averages, usually as a ratio of one to the other, which dampens the day-to-day noise and makes it “somewhat bounded”, with extremes “beyond which they rarely go”. Their warning comes in the same breath. The overbought and oversold levels “have been arbitrarily determined for each oscillator”, and mechanical signals from an oscillator alone “have not proven to be successful”, because how it behaves depends on whether the price is trending. Keep that in mind through what follows: each indicator is described with its traditional lines, and the evidence on those lines comes at the end of each section. The post builds three of them on SPY’s closes from 2019 to 2023, works each by hand on 2020-03-16, the Monday the index fell eleven percent, and then asks how much they agree.

RSI: the average up-day against the average down-day

The relative strength index was introduced by Welles Wilder in 1978, and both Achelis and Murphy pause on the name: it does not compare one stock with another, it compares a stock’s own up-days with its own down-days. Over the last 14 days, average the gains on the days the close rose and, separately, the losses on the days it fell. Their ratio is the relative strength, RS, and the RSI squeezes it into 0 to 100. The averages are not plain means after the first day: Wilder’s rule, as the StockCharts page writes it, carries yesterday’s average forward with weight 13 and lets today in with weight 1, which is a slow exponential smoothing in disguise.

RSI, the result on the 0 to 100 scaleG, the average gain over up-daysD, the average loss over down-days

Gt=13 Gt−1+gaint14,Dt=13 Dt−1+losst14RSIt=100−1001+Gt/Dt\begin{aligned} \good{G_t} &= \frac{13\,\good{G_{t-1}} + \text{gain}_t}{14}, \qquad \risk{D_t} = \frac{13\,\risk{D_{t-1}} + \text{loss}_t}{14} \\[10pt] \key{\mathrm{RSI}_t} &= 100 - \frac{100}{1 + \good{G_t} / \risk{D_t}} \end{aligned}

On 2020-03-16 the close fell $26.80. The day before, the average gain stood at 3.333\good{3.333} and the average loss at 5.689\risk{5.689}. Today’s gain is zero, so the average gain shrinks to 3.094\good{3.094}; today’s loss is 26.80, so the average loss rises to 7.196\risk{7.196}. Their ratio is 0.430, and 100 minus 100 over 1.430 gives an RSI of 30.1\key{30.1}.

An eleven-percent day moved the RSI only to 30, because each day enters with a weight of one in fourteen. The RSI had already bottomed at 19.8 on 2020-02-28, in the first week of the fall, and stood at 29.6 on the price low of 2020-03-23. Both books call this a divergence, the indicator turning before the price; here it turned three weeks early, with the index still to fall another 24%.

Wilder’s lines are 70 and 30: above 70 the stock is “overbought”, below 30 “oversold”. Murphy adds that the lines drift with the market, 80 in a bull market and 20 in a bear one, and SPY shows why. From 2019 to 2023 the index rose, and its RSI spent 11.0% of days above 70 and only 1.5% below 30; its whole range was 19.8 to 82.3. The 30 line was reached in one crash, the 70 line in every good quarter.

Kirkpatrick and Dahlquist report what happens when the lines are tested as signals, and the answer is unkind to the usual reading. Two studies they summarise, Bauer and Dahlquist (1999, 878 stocks over 1985 to 1996) and Thomas (2003, 1,750 stocks over 1995 to 2001), found that selling when the RSI drops back under 70 and buying when it climbs back over 30 had “marginal returns”, a result the authors call “disappointing”, while the opposite rule, buying when the RSI is high, “outperformed all signals”. A trading magazine’s test on nineteen futures over 1994 to 2003, buying when the 14-day RSI crossed above 75 and selling at 25 or after twenty days, gave “a steady, straight equity curve”. Kirkpatrick and Dahlquist name this the “RSI is wrong” method, and SPY’s 11.0% of days above 70 in a market that doubled is the same picture: a high RSI in a rising market mostly means the market is rising. Both studies tested without regard to trend and over periods that rose, and the authors say so; the lesson is not that 70 is a buy, it is that 70 is not a sell.

The RSI depends on where you start it

The smoothing never fully forgets, so the RSI on a given day depends slightly on how much history was fed in before it. StockCharts says it uses at least 250 days before the start of a chart for that reason. The numbers here start the chain on the first day of 2019 with plain means over the first fourteen changes (an average gain of 1.554 and an average loss of 0.711), so a chart that starts earlier will differ in the second decimal place.

Stochastic %K: where today’s close sits in the recent range

Nobody is sure who invented the stochastic oscillator. Kirkpatrick and Dahlquist trace it to a 1950s set of lessons on Elliott waves, credit George Lane with promoting it from 1954, and report that the name came from the words “stochastic process” handwritten on the lesson material, which a software vendor adopted in 1978 because the indicator needed a name; it has nothing to do with randomness. The idea starts from an observation Murphy states in one line: in an uptrend, closes tend to sit near the top of each day’s range, and in a downtrend near the bottom. The indicator makes that a number for a window rather than a day. Take the highest high and the lowest low of the last 14 days; %K is how far up that range today’s close sits, as a percentage. A 3-day average of %K is called %D, and the pair is drawn together.

%K, the close's place in the 14-day rangeC, today's close

%Kt=100⋅Ct−L14H14−L14,%Dt=13(%Kt+%Kt−1+%Kt−2)\key{\%K_t} = 100 \cdot \frac{\good{C_t} - L_{14}}{H_{14} - L_{14}}, \qquad \%D_t = \tfrac{1}{3}\left(\key{\%K_t} + \key{\%K_{t-1}} + \key{\%K_{t-2}}\right)

The blog’s data has closing prices only, so the “highest high” and “lowest low” here are the highest and lowest close of the window, which makes the range a little narrower than a chart’s. On 2020-03-16 the highest close of the last 14 days was 284.47, on 2020-03-04, and the lowest was 218.09\good{218.09}: that day’s own close. The close is at the bottom of its range, so %K is exactly 0.0\key{0.0}, and %D, the mean of the last three, is 10.9.

That is the stochastic’s character. It cannot see how far the price fell, only where today’s close lies between the window’s two ends, so any day that sets a new 14-day low reads zero and any day that sets a new high reads 100. On SPY it sat above 80 on 49.6% of days and below 20 on 18.8%, because a rising index keeps closing near the top of its recent range. The books say this in their own ways: Achelis gives 20 and 80 as the usual lines, and StockCharts warns that an overbought reading in a strong uptrend does not mean a decline. Murphy’s version of the signal waits for %D to be past a line and diverging from the price, and only then takes the %K line crossing %D as the trigger.

Kirkpatrick and Dahlquist place the stochastic against the other two by what it does with the latest close. The RSI and the PPO smooth it in with weeks of history; the stochastic reports it raw, as a fraction of the window’s range, which is why it is “very sensitive to recent action” and why the slow version, “a moving average of the moving average of %K”, exists. Their reading of the tests matches the RSI’s: Thomas found the extreme readings “somewhat predictive” and the standard overbought and oversold rules a failure, and Bauer and Dahlquist found buying at the lows worked better than selling at the highs over a period that rose. In a trending market, they add, the oscillator “often will not reach one or the other extreme”, so a sell signal in a rising trend “must be suspect”: SPY’s %K spent half of five years above 80.

Fast, slow and full

Achelis lists four settings: the %K window, a “slowing” period that averages %K before it is drawn, the %D window, and the average type. A slowing of 1 is the fast stochastic, shown here; a slowing of 3 is the slow stochastic, which Murphy says most traders use because its signals are steadier. StockCharts’ “full” version exposes all three numbers, (14, 3, 3) by default.

PPO: the gap between two averages, in percent

The third indicator is the SMA cross post’s two averages turned into a line. Achelis’s price oscillator is the difference between a short and a long moving average, “almost identical to the MACD” except that the MACD fixes the windows at 12 and 26 days and reports the gap in dollars. The percentage price oscillator divides the gap by the long average, so a reading of −6% means the same on any stock. It is drawn with a signal line, a 9-day average of itself, and a histogram, the difference between the two. The averages are exponential: each day’s value is yesterday’s plus a fraction of today’s surprise, the fraction being two over the window plus one.

PPO, the short average's lead over the long one

Et(n)=Et−1(n)+2n+1(Ct−Et−1(n))PPOt=100⋅Et(12)−Et(26)Et(26)\begin{aligned} E^{(n)}_t &= E^{(n)}_{t-1} + \tfrac{2}{n+1}\left(C_t - E^{(n)}_{t-1}\right) \\[10pt] \key{\mathrm{PPO}_t} &= 100 \cdot \frac{E^{(12)}_t - E^{(26)}_t}{E^{(26)}_t} \end{aligned}

On 2020-03-16 the 12-day exponential average was 254.33 and the 26-day was 270.71. The gap is −16.38, which is the MACD in dollars, and divided by 270.71 it is a PPO of −6.05%\key{-6.05\%}. The signal line stood at −3.90% and the histogram at −2.16%, the line pulling away from its own average. Unlike the other two, the PPO has no fixed ceiling: on SPY it ran from −8.48% to +3.06%, and it was above zero on 71.5% of days, which is one more way of saying the index rose. Achelis’s assessment of the price oscillator is the SMA cross post’s lesson in a sentence: it “does an outstanding job of keeping you on the right side of the market during trending periods” and “produces small losses” in the choppy ones.

Kirkpatrick and Dahlquist describe the MACD, and so the PPO, as “a variation of the moving average crossover”, and they are precise about what the line adds. A crossing of zero is “just the same signals as would be generated from a moving average crossover”, the SMA cross post in a different panel. The signal line adds timing inside a trend: with the PPO above zero, an upward crossing of the signal line is a buy, and “downward crossings are not at all reliable while the trend is upward”. The histogram, the gap between the two lines, narrows before they cross, which is what the fourth panel below shows through April 2020.

Which average goes in the denominator

Achelis’s percentage version divides the gap by the shorter average; StockCharts’ PPO divides by the longer one, and that is the convention charting software follows and the one used here. On 2020-03-16 the two give −6.05% and −6.44%. They disagree most when the averages are far apart, which is exactly when the reading is extreme.

Three readings of one crash

Here are the three on the eleven-percent day and on a quiet day in a rising market, 2021-08-13:

DayRSI (0 to 100)Stochastic %K (0 to 100)PPO (% of the 26-day average)
2020-03-16, an eleven-percent fall30.10.0−6.05
2021-08-13, a calm uptrend66.9100.0+0.85

All three agree on the sign of each day, and they differ in speed. The stochastic is the fastest: %K read zero on the fall and 100 on the calm day, and after the 2020 low it was back above 20 the very next day, 2020-03-24. The RSI is slower, needing until 2020-04-08 to climb back over 50. The PPO is the slowest, because a 26-day average takes weeks to turn: it bottomed on the price low itself, 2020-03-23, and did not cross back above zero until 2020-04-16. Over the five years the RSI and the stochastic moved together (correlation 0.85), the RSI and the PPO less so (0.72), and the stochastic and the PPO least (0.48). The indicators post argued that three indicators from one window are one reading three times; these three use different windows and different arithmetic, and the 0.48 is what partly independent evidence looks like. Kirkpatrick and Dahlquist put the same point bluntly: price oscillators “do not add new information”, being “manipulations of the same data”, and “watching several different price oscillators calculated over the same period is silly”. Different windows, or a different input such as volume, are where new evidence comes from.

{"panels":[{"x0":49.4,"x1":564.73,"y0":29.16,"y1":198.75,"title":"1. SPY's close, January to August 2020","xlabel":"Date (2020)","ylabel":"Price (dollars)","xlog":false},{"x0":49.4,"x1":564.73,"y0":328.4,"y1":497.99,"title":"2. RSI: below 30 in the crash, above 70 in the recovery","xlabel":"Date (2020)","ylabel":"RSI (0 to 100)","xlog":false},{"x0":49.4,"x1":564.73,"y0":627.64,"y1":797.24,"title":"3. Stochastic: pinned to 0 as every close is a new low","xlabel":"Date (2020)","ylabel":"Stochastic (0 to 100)","xlog":false},{"x0":49.4,"x1":564.73,"y0":926.88,"y1":1096.48,"title":"4. PPO: the fast average's lead over the slow one, in percent","xlabel":"Date (2020)","ylabel":"PPO (% of the 26-day average)","xlog":false}],"series":[{"panel":0,"label":"SPY close","color":"var(--chart-maroon, #b6262c)","x":["2020-01-02","2020-01-03","2020-01-06","2020-01-07","2020-01-08","2020-01-09","2020-01-10","2020-01-13","2020-01-14","2020-01-15","2020-01-16","2020-01-17","2020-01-21","2020-01-22","2020-01-23","2020-01-24","2020-01-27","2020-01-28","2020-01-29","2020-01-30","2020-01-31","2020-02-03","2020-02-04","2020-02-05","2020-02-06","2020-02-07","2020-02-10","2020-02-11","2020-02-12","2020-02-13","2020-02-14","2020-02-18","2020-02-19","2020-02-20","2020-02-21","2020-02-24","2020-02-25","2020-02-26","2020-02-27","2020-02-28","2020-03-02","2020-03-03","2020-03-04","2020-03-05","2020-03-06","2020-03-09","2020-03-10","2020-03-11","2020-03-12","2020-03-13","2020-03-16","2020-03-17","2020-03-18","2020-03-19","2020-03-20","2020-03-23","2020-03-24","2020-03-25","2020-03-26","2020-03-27","2020-03-30","2020-03-31","2020-04-01","2020-04-02","2020-04-03","2020-04-06","2020-04-07","2020-04-08","2020-04-09","2020-04-13","2020-04-14","2020-04-15","2020-04-16","2020-04-17","2020-04-20","2020-04-21","2020-04-22","2020-04-23","2020-04-24","2020-04-27","2020-04-28","2020-04-29","2020-04-30","2020-05-01","2020-05-04","2020-05-05","2020-05-06","2020-05-07","2020-05-08","2020-05-11","2020-05-12","2020-05-13","2020-05-14","2020-05-15","2020-05-18","2020-05-19","2020-05-20","2020-05-21","2020-05-22","2020-05-26","2020-05-27","2020-05-28","2020-05-29","2020-06-01","2020-06-02","2020-06-03","2020-06-04","2020-06-05","2020-06-08","2020-06-09","2020-06-10","2020-06-11","2020-06-12","2020-06-15","2020-06-16","2020-06-17","2020-06-18","2020-06-19","2020-06-22","2020-06-23","2020-06-24","2020-06-25","2020-06-26","2020-06-29","2020-06-30","2020-07-01","2020-07-02","2020-07-06","2020-07-07","2020-07-08","2020-07-09","2020-07-10","2020-07-13","2020-07-14","2020-07-15","2020-07-16","2020-07-17","2020-07-20","2020-07-21","2020-07-22","2020-07-23","2020-07-24","2020-07-27","2020-07-28","2020-07-29","2020-07-30","2020-07-31","2020-08-03","2020-08-04","2020-08-05","2020-08-06","2020-08-07","2020-08-10","2020-08-11","2020-08-12","2020-08-13","2020-08-14","2020-08-17","2020-08-18","2020-08-19","2020-08-20","2020-08-21","2020-08-24","2020-08-25","2020-08-26","2020-08-27","2020-08-28","2020-08-31"],"y":[295.392,293.155,294.273,293.446,295.01,297.01,296.156,298.192,297.738,298.411,300.893,301.829,301.238,301.275,301.62,298.938,294.146,297.228,296.983,297.947,292.537,294.71,299.202,302.657,303.675,302.057,304.312,304.839,306.803,306.476,306.967,306.176,307.639,306.376,303.221,293.164,284.281,283.235,270.514,269.378,281.044,272.997,284.471,275.015,270.469,249.347,262.249,249.465,225.597,244.882,218.086,229.861,218.223,218.686,209.262,203.912,222.387,225.716,238.896,231.78,239.307,235.74,225.131,230.326,226.997,242.243,242.49,250.63,254.444,252.121,259.557,254.042,255.267,262.163,257.545,249.725,255.267,255.249,258.807,262.538,261.331,268.172,265.675,258.642,259.355,261.752,259.977,263.115,267.468,267.523,262.191,257.554,260.636,261.834,269.809,267.038,271.575,269.7,270.212,273.541,277.611,277.099,278.334,279.459,281.772,285.522,284.772,292.071,295.601,293.397,291.76,274.94,278.233,280.83,286.236,285.047,285.156,283.527,285.346,286.659,279.347,282.342,275.636,279.687,283.27,285.254,286.825,291.253,288.249,290.453,288.8,291.749,289.222,292.971,295.662,294.688,295.543,297.931,298.565,300.264,296.682,294.771,296.921,295.037,298.666,297.6,299.952,302.037,303.204,305.087,307.127,307.347,308.266,305.721,309.983,309.423,309.432,310.415,311.086,309.791,310.755,311.858,315.017,316.12,319.289,319.987,322.054,320.888],"sx":[72.83,74.76,80.57,82.51,84.44,86.38,88.31,94.12,96.06,97.99,99.93,101.86,109.61,111.54,113.48,115.42,121.22,123.16,125.1,127.03,128.97,134.77,136.71,138.65,140.58,142.52,148.33,150.26,152.2,154.13,156.07,163.81,165.75,167.68,169.62,175.43,177.36,179.3,181.24,183.17,188.98,190.92,192.85,194.79,196.72,202.53,204.47,206.4,208.34,210.27,216.08,218.02,219.95,221.89,223.83,229.63,231.57,233.5,235.44,237.38,243.18,245.12,247.06,248.99,250.93,256.74,258.67,260.61,262.54,270.29,272.22,274.16,276.09,278.03,283.84,285.77,287.71,289.65,291.58,297.39,299.32,301.26,303.2,305.13,310.94,312.88,314.81,316.75,318.68,324.49,326.43,328.36,330.3,332.23,338.04,339.98,341.91,343.85,345.79,353.53,355.47,357.4,359.34,365.14,367.08,369.02,370.95,372.89,378.7,380.63,382.57,384.5,386.44,392.25,394.18,396.12,398.05,399.99,405.8,407.73,409.67,411.61,413.54,419.35,421.29,423.22,425.16,432.9,434.84,436.77,438.71,440.64,446.45,448.39,450.32,452.26,454.2,460.0,461.94,463.87,465.81,467.75,473.55,475.49,477.43,479.36,481.3,487.11,489.04,490.98,492.91,494.85,500.66,502.59,504.53,506.46,508.4,514.21,516.14,518.08,520.02,521.95,527.76,529.69,531.63,533.57,535.5,541.31],"sy":[71.66,74.58,73.12,74.2,72.16,69.55,70.66,68.01,68.6,67.72,64.48,63.26,64.03,63.98,63.53,67.03,73.29,69.26,69.58,68.33,75.39,72.55,66.69,62.18,60.85,62.96,60.02,59.33,56.77,57.2,56.56,57.59,55.68,57.33,61.44,74.57,86.16,87.53,104.13,105.61,90.38,100.89,85.91,98.25,104.18,131.75,114.91,131.59,162.74,137.58,172.54,157.18,172.37,171.76,184.06,191.04,166.93,162.59,145.39,154.67,144.85,149.51,163.35,156.57,160.92,141.02,140.7,130.07,125.1,128.13,118.43,125.62,124.02,115.02,121.05,131.26,124.02,124.05,119.4,114.53,116.11,107.18,110.44,119.62,118.69,115.56,117.88,113.78,108.1,108.03,114.99,121.04,117.02,115.45,105.05,108.66,102.74,105.19,104.52,100.18,94.86,95.53,93.92,92.45,89.43,84.54,85.52,75.99,71.39,74.26,76.4,98.35,94.05,90.66,83.61,85.16,85.02,87.14,84.77,83.06,92.6,88.69,97.44,92.16,87.48,84.89,82.84,77.06,80.98,78.11,80.26,76.41,79.71,74.82,71.31,72.58,71.46,68.35,67.52,65.3,69.98,72.47,69.67,72.12,67.39,68.78,65.71,62.99,61.47,59.01,56.35,56.06,54.86,58.18,52.62,53.35,53.34,52.06,51.18,52.87,51.61,50.17,46.05,44.61,40.47,39.56,36.87,38.39]},{"panel":1,"label":"RSI, 14 days","color":"var(--chart-maroon, #b6262c)","x":["2020-01-02","2020-01-03","2020-01-06","2020-01-07","2020-01-08","2020-01-09","2020-01-10","2020-01-13","2020-01-14","2020-01-15","2020-01-16","2020-01-17","2020-01-21","2020-01-22","2020-01-23","2020-01-24","2020-01-27","2020-01-28","2020-01-29","2020-01-30","2020-01-31","2020-02-03","2020-02-04","2020-02-05","2020-02-06","2020-02-07","2020-02-10","2020-02-11","2020-02-12","2020-02-13","2020-02-14","2020-02-18","2020-02-19","2020-02-20","2020-02-21","2020-02-24","2020-02-25","2020-02-26","2020-02-27","2020-02-28","2020-03-02","2020-03-03","2020-03-04","2020-03-05","2020-03-06","2020-03-09","2020-03-10","2020-03-11","2020-03-12","2020-03-13","2020-03-16","2020-03-17","2020-03-18","2020-03-19","2020-03-20","2020-03-23","2020-03-24","2020-03-25","2020-03-26","2020-03-27","2020-03-30","2020-03-31","2020-04-01","2020-04-02","2020-04-03","2020-04-06","2020-04-07","2020-04-08","2020-04-09","2020-04-13","2020-04-14","2020-04-15","2020-04-16","2020-04-17","2020-04-20","2020-04-21","2020-04-22","2020-04-23","2020-04-24","2020-04-27","2020-04-28","2020-04-29","2020-04-30","2020-05-01","2020-05-04","2020-05-05","2020-05-06","2020-05-07","2020-05-08","2020-05-11","2020-05-12","2020-05-13","2020-05-14","2020-05-15","2020-05-18","2020-05-19","2020-05-20","2020-05-21","2020-05-22","2020-05-26","2020-05-27","2020-05-28","2020-05-29","2020-06-01","2020-06-02","2020-06-03","2020-06-04","2020-06-05","2020-06-08","2020-06-09","2020-06-10","2020-06-11","2020-06-12","2020-06-15","2020-06-16","2020-06-17","2020-06-18","2020-06-19","2020-06-22","2020-06-23","2020-06-24","2020-06-25","2020-06-26","2020-06-29","2020-06-30","2020-07-01","2020-07-02","2020-07-06","2020-07-07","2020-07-08","2020-07-09","2020-07-10","2020-07-13","2020-07-14","2020-07-15","2020-07-16","2020-07-17","2020-07-20","2020-07-21","2020-07-22","2020-07-23","2020-07-24","2020-07-27","2020-07-28","2020-07-29","2020-07-30","2020-07-31","2020-08-03","2020-08-04","2020-08-05","2020-08-06","2020-08-07","2020-08-10","2020-08-11","2020-08-12","2020-08-13","2020-08-14","2020-08-17","2020-08-18","2020-08-19","2020-08-20","2020-08-21","2020-08-24","2020-08-25","2020-08-26","2020-08-27","2020-08-28","2020-08-31"],"y":[76.6618,66.1722,68.4933,64.9432,68.2893,71.9741,68.3207,71.9715,70.0316,71.266,75.3072,76.6419,73.9262,73.9873,74.5962,62.3869,47.4473,54.925,54.2627,56.4809,43.6753,48.7061,57.213,62.3812,63.7706,59.9797,63.2568,63.9992,66.6981,65.8124,66.5304,64.1915,66.5356,62.7181,54.3371,37.2503,28.6728,27.8596,20.3124,19.7964,37.3806,32.1452,44.1561,38.1613,35.655,26.8365,37.0745,32.2579,25.5767,36.9414,30.0705,35.7276,32.895,33.1225,30.8345,29.585,38.8062,40.3229,46.0258,43.603,46.7936,45.4806,41.7297,44.1582,42.9236,49.8401,49.946,53.4326,55.0139,53.8152,57.0416,54.027,54.6011,57.7954,55.004,50.5522,53.4292,53.4182,55.3518,57.3513,56.4702,60.2017,58.2394,52.999,53.4564,55.0394,53.5861,55.8079,58.7584,58.7958,53.7069,49.68,52.2433,53.2404,59.3278,56.5718,59.859,57.908,58.3078,60.9067,63.8717,63.222,64.1685,65.0509,66.8589,69.6033,68.3836,73.289,75.2864,71.6826,69.0387,49.0318,51.9663,54.2063,58.5393,57.2559,57.3489,55.4219,57.1525,58.4083,49.6793,52.791,45.9402,50.149,53.5902,55.4254,56.8792,60.7637,57.0113,59.0118,56.8741,59.6794,56.3006,59.9257,62.3416,60.911,61.7405,64.0384,64.6452,66.2878,59.9629,56.8476,59.4029,56.2598,60.5872,58.749,61.5236,63.8457,65.1141,67.1196,69.1855,69.4092,70.3746,64.3199,69.1135,67.8234,67.834,69.0105,69.8213,66.2172,67.5602,69.0733,72.966,74.1867,77.3529,77.9932,79.8129,75.993],"sx":[72.83,74.76,80.57,82.51,84.44,86.38,88.31,94.12,96.06,97.99,99.93,101.86,109.61,111.54,113.48,115.42,121.22,123.16,125.1,127.03,128.97,134.77,136.71,138.65,140.58,142.52,148.33,150.26,152.2,154.13,156.07,163.81,165.75,167.68,169.62,175.43,177.36,179.3,181.24,183.17,188.98,190.92,192.85,194.79,196.72,202.53,204.47,206.4,208.34,210.27,216.08,218.02,219.95,221.89,223.83,229.63,231.57,233.5,235.44,237.38,243.18,245.12,247.06,248.99,250.93,256.74,258.67,260.61,262.54,270.29,272.22,274.16,276.09,278.03,283.84,285.77,287.71,289.65,291.58,297.39,299.32,301.26,303.2,305.13,310.94,312.88,314.81,316.75,318.68,324.49,326.43,328.36,330.3,332.23,338.04,339.98,341.91,343.85,345.79,353.53,355.47,357.4,359.34,365.14,367.08,369.02,370.95,372.89,378.7,380.63,382.57,384.5,386.44,392.25,394.18,396.12,398.05,399.99,405.8,407.73,409.67,411.61,413.54,419.35,421.29,423.22,425.16,432.9,434.84,436.77,438.71,440.64,446.45,448.39,450.32,452.26,454.2,460.0,461.94,463.87,465.81,467.75,473.55,475.49,477.43,479.36,481.3,487.11,489.04,490.98,492.91,494.85,500.66,502.59,504.53,506.46,508.4,514.21,516.14,518.08,520.02,521.95,527.76,529.69,531.63,533.57,535.5,541.31],"sy":[367.98,385.77,381.83,387.85,382.18,375.93,382.13,375.93,379.22,377.13,370.28,368.01,372.62,372.52,371.48,392.19,417.53,404.84,405.97,402.21,423.92,415.39,400.96,392.2,389.84,396.27,390.71,389.45,384.88,386.38,385.16,389.13,385.15,391.63,405.84,434.82,449.37,450.74,463.54,464.42,434.6,443.48,423.11,433.27,437.52,452.48,435.12,443.29,454.62,435.34,447.0,437.4,442.21,441.82,445.7,447.82,432.18,429.61,419.94,424.05,418.63,420.86,427.22,423.1,425.2,413.47,413.29,407.37,404.69,406.73,401.25,406.37,405.39,399.98,404.71,412.26,407.38,407.4,404.12,400.73,402.22,395.89,399.22,408.11,407.33,404.65,407.11,403.35,398.34,398.28,406.91,413.74,409.39,407.7,397.38,402.05,396.48,399.78,399.11,394.7,389.67,390.77,389.17,387.67,384.6,379.95,382.02,373.7,370.31,376.42,380.91,414.84,409.86,406.06,398.71,400.89,400.73,404.0,401.07,398.94,413.74,408.46,420.08,412.94,407.11,404.0,401.53,394.94,401.31,397.91,401.54,396.78,402.51,396.36,392.27,394.69,393.29,389.39,388.36,385.57,396.3,401.58,397.25,402.58,395.24,398.36,393.65,389.71,387.56,384.16,380.66,380.28,378.64,388.91,380.78,382.97,382.95,380.96,379.58,385.69,383.42,380.85,374.25,372.18,366.81,365.72,362.64,369.11]},{"panel":2,"label":"%K, 14 days, from closes","color":"var(--chart-maroon, #b6262c)","x":["2020-01-02","2020-01-03","2020-01-06","2020-01-07","2020-01-08","2020-01-09","2020-01-10","2020-01-13","2020-01-14","2020-01-15","2020-01-16","2020-01-17","2020-01-21","2020-01-22","2020-01-23","2020-01-24","2020-01-27","2020-01-28","2020-01-29","2020-01-30","2020-01-31","2020-02-03","2020-02-04","2020-02-05","2020-02-06","2020-02-07","2020-02-10","2020-02-11","2020-02-12","2020-02-13","2020-02-14","2020-02-18","2020-02-19","2020-02-20","2020-02-21","2020-02-24","2020-02-25","2020-02-26","2020-02-27","2020-02-28","2020-03-02","2020-03-03","2020-03-04","2020-03-05","2020-03-06","2020-03-09","2020-03-10","2020-03-11","2020-03-12","2020-03-13","2020-03-16","2020-03-17","2020-03-18","2020-03-19","2020-03-20","2020-03-23","2020-03-24","2020-03-25","2020-03-26","2020-03-27","2020-03-30","2020-03-31","2020-04-01","2020-04-02","2020-04-03","2020-04-06","2020-04-07","2020-04-08","2020-04-09","2020-04-13","2020-04-14","2020-04-15","2020-04-16","2020-04-17","2020-04-20","2020-04-21","2020-04-22","2020-04-23","2020-04-24","2020-04-27","2020-04-28","2020-04-29","2020-04-30","2020-05-01","2020-05-04","2020-05-05","2020-05-06","2020-05-07","2020-05-08","2020-05-11","2020-05-12","2020-05-13","2020-05-14","2020-05-15","2020-05-18","2020-05-19","2020-05-20","2020-05-21","2020-05-22","2020-05-26","2020-05-27","2020-05-28","2020-05-29","2020-06-01","2020-06-02","2020-06-03","2020-06-04","2020-06-05","2020-06-08","2020-06-09","2020-06-10","2020-06-11","2020-06-12","2020-06-15","2020-06-16","2020-06-17","2020-06-18","2020-06-19","2020-06-22","2020-06-23","2020-06-24","2020-06-25","2020-06-26","2020-06-29","2020-06-30","2020-07-01","2020-07-02","2020-07-06","2020-07-07","2020-07-08","2020-07-09","2020-07-10","2020-07-13","2020-07-14","2020-07-15","2020-07-16","2020-07-17","2020-07-20","2020-07-21","2020-07-22","2020-07-23","2020-07-24","2020-07-27","2020-07-28","2020-07-29","2020-07-30","2020-07-31","2020-08-03","2020-08-04","2020-08-05","2020-08-06","2020-08-07","2020-08-10","2020-08-11","2020-08-12","2020-08-13","2020-08-14","2020-08-17","2020-08-18","2020-08-19","2020-08-20","2020-08-21","2020-08-24","2020-08-25","2020-08-26","2020-08-27","2020-08-28","2020-08-31"],"y":[100.0,72.9741,82.2576,68.8203,93.8627,100.0,84.1201,100.0,92.7224,100.0,100.0,100.0,93.5582,93.6064,97.5894,65.5088,8.35113,40.1187,36.9234,49.4664,0.0,23.3855,71.7224,100.0,100.0,85.4684,100.0,100.0,100.0,97.7051,100.0,94.517,100.0,91.6313,65.8234,0.0,0.0,0.0,0.0,0.0,30.4896,9.45805,39.4484,14.7336,2.85142,0.0,22.6242,0.219402,0.0,32.757,0.0,17.7373,0.205468,0.903968,0.0,0.0,25.9833,32.7603,59.9683,47.7707,77.7012,77.6861,51.7907,74.6254,65.2197,100.0,100.0,100.0,100.0,92.7532,100.0,83.9798,87.5396,100.0,87.5277,66.4114,80.39,80.3379,83.1498,100.0,90.5788,100.0,86.465,48.3394,52.206,65.1957,55.5777,72.583,96.1822,94.975,53.7153,0.0,29.0274,40.3104,100.0,77.3877,100.0,86.6271,90.2802,100.0,100.0,97.4468,100.0,100.0,100.0,100.0,96.8339,100.0,100.0,91.4909,85.1697,18.6242,21.269,28.5084,54.6699,48.9151,49.4465,41.5597,50.3628,56.7207,21.3287,35.8232,3.7677,28.2206,71.0752,87.2501,100.0,100.0,80.7638,94.8812,84.2933,100.0,84.3213,100.0,100.0,95.1379,99.252,100.0,100.0,100.0,70.184,54.2823,70.8334,54.408,85.5242,75.8737,95.7197,100.0,100.0,100.0,100.0,100.0,100.0,81.1437,100.0,96.2505,96.3121,100.0,100.0,88.3669,96.3463,100.0,100.0,100.0,100.0,100.0,100.0,90.7633],"sx":[72.83,74.76,80.57,82.51,84.44,86.38,88.31,94.12,96.06,97.99,99.93,101.86,109.61,111.54,113.48,115.42,121.22,123.16,125.1,127.03,128.97,134.77,136.71,138.65,140.58,142.52,148.33,150.26,152.2,154.13,156.07,163.81,165.75,167.68,169.62,175.43,177.36,179.3,181.24,183.17,188.98,190.92,192.85,194.79,196.72,202.53,204.47,206.4,208.34,210.27,216.08,218.02,219.95,221.89,223.83,229.63,231.57,233.5,235.44,237.38,243.18,245.12,247.06,248.99,250.93,256.74,258.67,260.61,262.54,270.29,272.22,274.16,276.09,278.03,283.84,285.77,287.71,289.65,291.58,297.39,299.32,301.26,303.2,305.13,310.94,312.88,314.81,316.75,318.68,324.49,326.43,328.36,330.3,332.23,338.04,339.98,341.91,343.85,345.79,353.53,355.47,357.4,359.34,365.14,367.08,369.02,370.95,372.89,378.7,380.63,382.57,384.5,386.44,392.25,394.18,396.12,398.05,399.99,405.8,407.73,409.67,411.61,413.54,419.35,421.29,423.22,425.16,432.9,434.84,436.77,438.71,440.64,446.45,448.39,450.32,452.26,454.2,460.0,461.94,463.87,465.81,467.75,473.55,475.49,477.43,479.36,481.3,487.11,489.04,490.98,492.91,494.85,500.66,502.59,504.53,506.46,508.4,514.21,516.14,518.08,520.02,521.95,527.76,529.69,531.63,533.57,535.5,541.31],"sy":[627.64,673.48,657.73,680.52,638.05,627.64,654.57,627.64,639.98,627.64,627.64,627.64,638.57,638.49,631.73,686.14,783.07,729.2,734.62,713.34,797.24,757.57,675.6,627.64,627.64,652.29,627.64,627.64,627.64,631.53,627.64,636.94,627.64,641.84,685.6,797.24,797.24,797.24,797.24,797.24,745.53,781.19,730.33,772.25,792.4,797.24,758.87,796.86,797.24,741.68,797.24,767.15,796.89,795.7,797.24,797.24,753.17,741.68,695.53,716.22,665.46,665.49,709.4,670.68,686.63,627.64,627.64,627.64,627.64,639.93,627.64,654.81,648.77,627.64,648.79,684.61,660.9,660.99,656.22,627.64,643.62,627.64,650.6,715.26,708.7,686.67,702.98,674.14,634.12,636.16,706.14,797.24,748.01,728.87,627.64,665.99,627.64,650.32,644.13,627.64,627.64,631.97,627.64,627.64,627.64,627.64,633.01,627.64,627.64,642.07,652.79,765.65,761.16,748.89,704.52,714.28,713.38,726.75,711.82,701.04,761.06,736.48,790.85,749.37,676.7,649.27,627.64,627.64,660.27,636.32,654.28,627.64,654.23,627.64,627.64,635.89,628.91,627.64,627.64,627.64,678.21,705.18,677.11,704.96,652.19,668.56,634.9,627.64,627.64,627.64,627.64,627.64,627.64,659.62,627.64,634.0,633.9,627.64,627.64,647.37,633.84,627.64,627.64,627.64,627.64,627.64,627.64,643.31]},{"panel":2,"label":"%D, 3-day average of %K","color":"var(--chart-blue, #3b6ea5)","x":["2020-01-02","2020-01-03","2020-01-06","2020-01-07","2020-01-08","2020-01-09","2020-01-10","2020-01-13","2020-01-14","2020-01-15","2020-01-16","2020-01-17","2020-01-21","2020-01-22","2020-01-23","2020-01-24","2020-01-27","2020-01-28","2020-01-29","2020-01-30","2020-01-31","2020-02-03","2020-02-04","2020-02-05","2020-02-06","2020-02-07","2020-02-10","2020-02-11","2020-02-12","2020-02-13","2020-02-14","2020-02-18","2020-02-19","2020-02-20","2020-02-21","2020-02-24","2020-02-25","2020-02-26","2020-02-27","2020-02-28","2020-03-02","2020-03-03","2020-03-04","2020-03-05","2020-03-06","2020-03-09","2020-03-10","2020-03-11","2020-03-12","2020-03-13","2020-03-16","2020-03-17","2020-03-18","2020-03-19","2020-03-20","2020-03-23","2020-03-24","2020-03-25","2020-03-26","2020-03-27","2020-03-30","2020-03-31","2020-04-01","2020-04-02","2020-04-03","2020-04-06","2020-04-07","2020-04-08","2020-04-09","2020-04-13","2020-04-14","2020-04-15","2020-04-16","2020-04-17","2020-04-20","2020-04-21","2020-04-22","2020-04-23","2020-04-24","2020-04-27","2020-04-28","2020-04-29","2020-04-30","2020-05-01","2020-05-04","2020-05-05","2020-05-06","2020-05-07","2020-05-08","2020-05-11","2020-05-12","2020-05-13","2020-05-14","2020-05-15","2020-05-18","2020-05-19","2020-05-20","2020-05-21","2020-05-22","2020-05-26","2020-05-27","2020-05-28","2020-05-29","2020-06-01","2020-06-02","2020-06-03","2020-06-04","2020-06-05","2020-06-08","2020-06-09","2020-06-10","2020-06-11","2020-06-12","2020-06-15","2020-06-16","2020-06-17","2020-06-18","2020-06-19","2020-06-22","2020-06-23","2020-06-24","2020-06-25","2020-06-26","2020-06-29","2020-06-30","2020-07-01","2020-07-02","2020-07-06","2020-07-07","2020-07-08","2020-07-09","2020-07-10","2020-07-13","2020-07-14","2020-07-15","2020-07-16","2020-07-17","2020-07-20","2020-07-21","2020-07-22","2020-07-23","2020-07-24","2020-07-27","2020-07-28","2020-07-29","2020-07-30","2020-07-31","2020-08-03","2020-08-04","2020-08-05","2020-08-06","2020-08-07","2020-08-10","2020-08-11","2020-08-12","2020-08-13","2020-08-14","2020-08-17","2020-08-18","2020-08-19","2020-08-20","2020-08-21","2020-08-24","2020-08-25","2020-08-26","2020-08-27","2020-08-28","2020-08-31"],"y":[90.7548,87.4115,85.0772,74.684,81.6469,87.561,92.6609,94.7067,92.2808,97.5741,97.5741,100.0,97.8527,95.7215,94.918,85.5682,57.1498,37.9929,28.4644,42.1695,28.7966,24.284,31.7026,65.036,90.5741,95.1561,95.1561,95.1561,100.0,99.235,99.235,97.4074,98.1723,95.3828,85.8182,52.4849,21.9411,0.0,0.0,0.0,10.1632,13.3159,26.4654,21.2133,19.0111,5.86166,8.49187,7.61453,7.61453,10.9921,10.919,16.8314,5.98091,6.28223,0.369812,0.301323,8.66111,19.5812,39.5706,46.8331,61.8134,67.7193,69.0593,68.0341,63.8786,79.9484,88.4066,100.0,100.0,97.5844,97.5844,92.2443,90.5065,90.5065,91.6891,84.6464,78.1097,75.7131,81.2926,87.8292,91.2429,96.8596,92.3479,78.2681,62.3368,55.247,57.6598,64.4521,74.781,87.9134,81.6242,49.5635,27.5809,23.1126,56.4459,72.566,92.4626,88.0049,92.3024,92.3024,96.7601,99.1489,99.1489,99.1489,100.0,100.0,98.9446,98.9446,98.9446,97.1636,92.2202,65.0949,41.6876,22.8005,34.8158,44.0312,51.0105,46.6404,47.123,49.5477,42.804,37.9575,20.3065,22.6039,34.3545,62.182,86.1084,95.75,93.5879,91.8817,86.6461,93.0582,89.5382,94.7738,94.7738,98.3793,98.13,98.13,99.7507,100.0,90.0613,74.8221,65.0999,59.8412,70.2552,71.9353,85.7059,90.5311,98.5732,100.0,100.0,100.0,100.0,93.7146,93.7146,92.4647,97.5209,97.5209,98.7707,96.1223,94.9044,94.9044,98.7821,100.0,100.0,100.0,100.0,96.9211],"sx":[72.83,74.76,80.57,82.51,84.44,86.38,88.31,94.12,96.06,97.99,99.93,101.86,109.61,111.54,113.48,115.42,121.22,123.16,125.1,127.03,128.97,134.77,136.71,138.65,140.58,142.52,148.33,150.26,152.2,154.13,156.07,163.81,165.75,167.68,169.62,175.43,177.36,179.3,181.24,183.17,188.98,190.92,192.85,194.79,196.72,202.53,204.47,206.4,208.34,210.27,216.08,218.02,219.95,221.89,223.83,229.63,231.57,233.5,235.44,237.38,243.18,245.12,247.06,248.99,250.93,256.74,258.67,260.61,262.54,270.29,272.22,274.16,276.09,278.03,283.84,285.77,287.71,289.65,291.58,297.39,299.32,301.26,303.2,305.13,310.94,312.88,314.81,316.75,318.68,324.49,326.43,328.36,330.3,332.23,338.04,339.98,341.91,343.85,345.79,353.53,355.47,357.4,359.34,365.14,367.08,369.02,370.95,372.89,378.7,380.63,382.57,384.5,386.44,392.25,394.18,396.12,398.05,399.99,405.8,407.73,409.67,411.61,413.54,419.35,421.29,423.22,425.16,432.9,434.84,436.77,438.71,440.64,446.45,448.39,450.32,452.26,454.2,460.0,461.94,463.87,465.81,467.75,473.55,475.49,477.43,479.36,481.3,487.11,489.04,490.98,492.91,494.85,500.66,502.59,504.53,506.46,508.4,514.21,516.14,518.08,520.02,521.95,527.76,529.69,531.63,533.57,535.5,541.31],"sy":[643.32,648.99,652.95,670.58,658.77,648.74,640.09,636.62,640.73,631.76,631.76,627.64,631.28,634.9,636.26,652.12,700.31,732.8,748.96,725.72,748.4,756.05,743.47,686.94,643.63,635.86,635.86,635.86,627.64,628.94,628.94,632.04,630.74,635.47,651.69,708.22,760.02,797.24,797.24,797.24,780.0,774.65,752.35,761.26,764.99,787.29,782.83,784.32,784.32,778.59,778.72,768.69,787.09,786.58,796.61,796.72,782.55,764.03,730.13,717.81,692.4,682.39,680.12,681.85,688.9,661.65,647.3,627.64,627.64,631.74,631.74,640.8,643.74,643.74,641.74,653.68,664.77,668.83,659.37,648.28,642.49,632.97,640.62,664.5,691.52,703.54,699.45,687.93,670.41,648.14,658.81,713.18,750.46,758.04,701.51,674.17,640.43,647.99,640.7,640.7,633.14,629.09,629.09,629.09,627.64,627.64,629.43,629.43,629.43,632.45,640.84,686.84,726.54,758.57,738.19,722.56,710.73,718.14,717.32,713.21,724.64,732.86,762.8,758.9,738.97,691.78,651.2,634.85,638.52,641.41,650.29,639.42,645.38,636.51,636.51,630.39,630.81,630.81,628.07,627.64,644.5,670.34,686.83,695.75,678.09,675.24,651.88,643.7,630.06,627.64,627.64,627.64,627.64,638.3,638.3,640.42,631.85,631.85,629.73,634.22,636.28,636.28,629.71,627.64,627.64,627.64,627.64,632.86]},{"panel":3,"label":"PPO, 12/26-day","color":"var(--chart-maroon, #b6262c)","x":["2020-01-02","2020-01-03","2020-01-06","2020-01-07","2020-01-08","2020-01-09","2020-01-10","2020-01-13","2020-01-14","2020-01-15","2020-01-16","2020-01-17","2020-01-21","2020-01-22","2020-01-23","2020-01-24","2020-01-27","2020-01-28","2020-01-29","2020-01-30","2020-01-31","2020-02-03","2020-02-04","2020-02-05","2020-02-06","2020-02-07","2020-02-10","2020-02-11","2020-02-12","2020-02-13","2020-02-14","2020-02-18","2020-02-19","2020-02-20","2020-02-21","2020-02-24","2020-02-25","2020-02-26","2020-02-27","2020-02-28","2020-03-02","2020-03-03","2020-03-04","2020-03-05","2020-03-06","2020-03-09","2020-03-10","2020-03-11","2020-03-12","2020-03-13","2020-03-16","2020-03-17","2020-03-18","2020-03-19","2020-03-20","2020-03-23","2020-03-24","2020-03-25","2020-03-26","2020-03-27","2020-03-30","2020-03-31","2020-04-01","2020-04-02","2020-04-03","2020-04-06","2020-04-07","2020-04-08","2020-04-09","2020-04-13","2020-04-14","2020-04-15","2020-04-16","2020-04-17","2020-04-20","2020-04-21","2020-04-22","2020-04-23","2020-04-24","2020-04-27","2020-04-28","2020-04-29","2020-04-30","2020-05-01","2020-05-04","2020-05-05","2020-05-06","2020-05-07","2020-05-08","2020-05-11","2020-05-12","2020-05-13","2020-05-14","2020-05-15","2020-05-18","2020-05-19","2020-05-20","2020-05-21","2020-05-22","2020-05-26","2020-05-27","2020-05-28","2020-05-29","2020-06-01","2020-06-02","2020-06-03","2020-06-04","2020-06-05","2020-06-08","2020-06-09","2020-06-10","2020-06-11","2020-06-12","2020-06-15","2020-06-16","2020-06-17","2020-06-18","2020-06-19","2020-06-22","2020-06-23","2020-06-24","2020-06-25","2020-06-26","2020-06-29","2020-06-30","2020-07-01","2020-07-02","2020-07-06","2020-07-07","2020-07-08","2020-07-09","2020-07-10","2020-07-13","2020-07-14","2020-07-15","2020-07-16","2020-07-17","2020-07-20","2020-07-21","2020-07-22","2020-07-23","2020-07-24","2020-07-27","2020-07-28","2020-07-29","2020-07-30","2020-07-31","2020-08-03","2020-08-04","2020-08-05","2020-08-06","2020-08-07","2020-08-10","2020-08-11","2020-08-12","2020-08-13","2020-08-14","2020-08-17","2020-08-18","2020-08-19","2020-08-20","2020-08-21","2020-08-24","2020-08-25","2020-08-26","2020-08-27","2020-08-28","2020-08-31"],"y":[1.18423,1.14087,1.12435,1.07583,1.06813,1.10419,1.09627,1.1326,1.13547,1.1427,1.20198,1.25934,1.27352,1.27072,1.26297,1.17064,0.956818,0.860947,0.769459,0.714854,0.518779,0.417543,0.454237,0.570329,0.681563,0.717326,0.796987,0.86391,0.9581,1.01177,1.05482,1.05535,1.08195,1.05702,0.94263,0.577765,0.048485,-0.398059,-1.0911,-1.66127,-1.77308,-2.06551,-1.95397,-2.10894,-2.33667,-3.09506,-3.2952,-3.79284,-4.86402,-5.09286,-6.051,-6.39517,-6.98073,-7.37015,-7.92498,-8.4794,-8.21164,-7.79988,-6.93856,-6.42665,-5.69546,-5.17821,-5.07565,-4.7623,-4.57755,-3.85888,-3.24354,-2.45007,-1.67574,-1.13006,-0.447977,-0.0917893,0.226508,0.692968,0.899981,0.802119,0.892675,0.952363,1.10028,1.31984,1.43727,1.72442,1.84958,1.70834,1.6002,1.57103,1.47535,1.47994,1.59953,1.67541,1.55256,1.29717,1.17651,1.1052,1.27964,1.31639,1.46673,1.51005,1.54147,1.64746,1.83152,1.9376,2.03345,2.11681,2.22397,2.38943,2.46753,2.70774,2.96099,3.05876,3.05174,2.53788,2.1993,1.98259,1.94306,1.85594,1.76941,1.63539,1.56292,1.52508,1.27226,1.1441,0.841308,0.70895,0.698659,0.738649,0.805643,0.973016,1.00795,1.08513,1.08658,1.15715,1.12857,1.19705,1.31076,1.35718,1.40094,1.48399,1.54851,1.62673,1.57148,1.4583,1.41119,1.30707,1.30869,1.26597,1.28127,1.33431,1.39129,1.46967,1.5677,1.63139,1.68606,1.64181,1.70015,1.7109,1.69945,1.69624,1.69131,1.63403,1.5953,1.57499,1.62233,1.66849,1.76604,1.83888,1.92635,1.94207],"sx":[72.83,74.76,80.57,82.51,84.44,86.38,88.31,94.12,96.06,97.99,99.93,101.86,109.61,111.54,113.48,115.42,121.22,123.16,125.1,127.03,128.97,134.77,136.71,138.65,140.58,142.52,148.33,150.26,152.2,154.13,156.07,163.81,165.75,167.68,169.62,175.43,177.36,179.3,181.24,183.17,188.98,190.92,192.85,194.79,196.72,202.53,204.47,206.4,208.34,210.27,216.08,218.02,219.95,221.89,223.83,229.63,231.57,233.5,235.44,237.38,243.18,245.12,247.06,248.99,250.93,256.74,258.67,260.61,262.54,270.29,272.22,274.16,276.09,278.03,283.84,285.77,287.71,289.65,291.58,297.39,299.32,301.26,303.2,305.13,310.94,312.88,314.81,316.75,318.68,324.49,326.43,328.36,330.3,332.23,338.04,339.98,341.91,343.85,345.79,353.53,355.47,357.4,359.34,365.14,367.08,369.02,370.95,372.89,378.7,380.63,382.57,384.5,386.44,392.25,394.18,396.12,398.05,399.99,405.8,407.73,409.67,411.61,413.54,419.35,421.29,423.22,425.16,432.9,434.84,436.77,438.71,440.64,446.45,448.39,450.32,452.26,454.2,460.0,461.94,463.87,465.81,467.75,473.55,475.49,477.43,479.36,481.3,487.11,489.04,490.98,492.91,494.85,500.66,502.59,504.53,506.46,508.4,514.21,516.14,518.08,520.02,521.95,527.76,529.69,531.63,533.57,535.5,541.31],"sy":[959.64,960.22,960.44,961.09,961.19,960.71,960.82,960.33,960.29,960.2,959.4,958.64,958.45,958.49,958.59,959.82,962.68,963.96,965.18,965.91,968.53,969.89,969.4,967.84,966.36,965.88,964.82,963.92,962.66,961.95,961.37,961.36,961.01,961.34,962.87,967.75,974.82,980.78,990.05,997.66,999.16,1003.07,1001.57,1003.65,1006.69,1016.82,1019.5,1026.15,1040.46,1043.52,1056.32,1060.92,1068.74,1073.95,1081.36,1088.77,1085.19,1079.69,1068.18,1061.34,1051.57,1044.66,1043.29,1039.1,1036.63,1027.03,1018.81,1008.2,997.86,990.57,981.45,976.69,972.44,966.21,963.44,964.75,963.54,962.74,960.76,957.83,956.26,952.42,950.75,952.64,954.08,954.47,955.75,955.69,954.09,953.08,954.72,958.13,959.74,960.7,958.37,957.88,955.87,955.29,954.87,953.45,950.99,949.57,948.29,947.18,945.75,943.54,942.49,939.28,935.9,934.59,934.69,941.55,946.08,948.97,949.5,950.67,951.82,953.61,954.58,955.09,958.47,960.18,964.22,965.99,966.13,965.6,964.7,962.46,962.0,960.97,960.95,960.0,960.39,959.47,957.95,957.33,956.75,955.64,954.77,953.73,954.47,955.98,956.61,958.0,957.98,958.55,958.34,957.64,956.87,955.83,954.52,953.67,952.94,953.53,952.75,952.6,952.76,952.8,952.87,953.63,954.15,954.42,953.79,953.17,951.87,950.89,949.73,949.52]},{"panel":3,"label":"signal, 9-day average of PPO","color":"var(--chart-blue, #3b6ea5)","x":["2020-01-02","2020-01-03","2020-01-06","2020-01-07","2020-01-08","2020-01-09","2020-01-10","2020-01-13","2020-01-14","2020-01-15","2020-01-16","2020-01-17","2020-01-21","2020-01-22","2020-01-23","2020-01-24","2020-01-27","2020-01-28","2020-01-29","2020-01-30","2020-01-31","2020-02-03","2020-02-04","2020-02-05","2020-02-06","2020-02-07","2020-02-10","2020-02-11","2020-02-12","2020-02-13","2020-02-14","2020-02-18","2020-02-19","2020-02-20","2020-02-21","2020-02-24","2020-02-25","2020-02-26","2020-02-27","2020-02-28","2020-03-02","2020-03-03","2020-03-04","2020-03-05","2020-03-06","2020-03-09","2020-03-10","2020-03-11","2020-03-12","2020-03-13","2020-03-16","2020-03-17","2020-03-18","2020-03-19","2020-03-20","2020-03-23","2020-03-24","2020-03-25","2020-03-26","2020-03-27","2020-03-30","2020-03-31","2020-04-01","2020-04-02","2020-04-03","2020-04-06","2020-04-07","2020-04-08","2020-04-09","2020-04-13","2020-04-14","2020-04-15","2020-04-16","2020-04-17","2020-04-20","2020-04-21","2020-04-22","2020-04-23","2020-04-24","2020-04-27","2020-04-28","2020-04-29","2020-04-30","2020-05-01","2020-05-04","2020-05-05","2020-05-06","2020-05-07","2020-05-08","2020-05-11","2020-05-12","2020-05-13","2020-05-14","2020-05-15","2020-05-18","2020-05-19","2020-05-20","2020-05-21","2020-05-22","2020-05-26","2020-05-27","2020-05-28","2020-05-29","2020-06-01","2020-06-02","2020-06-03","2020-06-04","2020-06-05","2020-06-08","2020-06-09","2020-06-10","2020-06-11","2020-06-12","2020-06-15","2020-06-16","2020-06-17","2020-06-18","2020-06-19","2020-06-22","2020-06-23","2020-06-24","2020-06-25","2020-06-26","2020-06-29","2020-06-30","2020-07-01","2020-07-02","2020-07-06","2020-07-07","2020-07-08","2020-07-09","2020-07-10","2020-07-13","2020-07-14","2020-07-15","2020-07-16","2020-07-17","2020-07-20","2020-07-21","2020-07-22","2020-07-23","2020-07-24","2020-07-27","2020-07-28","2020-07-29","2020-07-30","2020-07-31","2020-08-03","2020-08-04","2020-08-05","2020-08-06","2020-08-07","2020-08-10","2020-08-11","2020-08-12","2020-08-13","2020-08-14","2020-08-17","2020-08-18","2020-08-19","2020-08-20","2020-08-21","2020-08-24","2020-08-25","2020-08-26","2020-08-27","2020-08-28","2020-08-31"],"y":[1.12268,1.12632,1.12592,1.11591,1.10635,1.10592,1.10399,1.10971,1.11486,1.12043,1.13674,1.16126,1.18371,1.20111,1.21348,1.20492,1.1553,1.09643,1.03103,0.967798,0.877994,0.785904,0.71957,0.689722,0.68809,0.693937,0.714547,0.74442,0.787156,0.832079,0.876626,0.912371,0.946286,0.968432,0.963272,0.88617,0.718633,0.495295,0.178015,-0.189843,-0.50649,-0.818295,-1.04543,-1.25813,-1.47384,-1.79808,-2.09751,-2.43657,-2.92206,-3.35622,-3.89518,-4.39518,-4.91229,-5.40386,-5.90808,-6.42235,-6.78021,-6.98414,-6.97502,-6.86535,-6.63137,-6.34074,-6.08772,-5.82264,-5.57362,-5.23067,-4.83324,-4.35661,-3.82044,-3.28236,-2.71548,-2.19074,-1.70729,-1.22724,-0.801797,-0.481014,-0.206276,0.025452,0.240417,0.456301,0.652495,0.866879,1.06342,1.1924,1.27396,1.33338,1.36177,1.3854,1.42823,1.47767,1.49264,1.45355,1.39814,1.33955,1.32757,1.32533,1.35361,1.3849,1.41621,1.46246,1.53628,1.61654,1.69992,1.7833,1.87143,1.97503,2.07353,2.20037,2.3525,2.49375,2.60535,2.59185,2.51334,2.40719,2.31436,2.22268,2.13203,2.0327,1.93874,1.85601,1.73926,1.62023,1.46444,1.31334,1.19041,1.10006,1.04117,1.02754,1.02362,1.03592,1.04605,1.06827,1.08033,1.10367,1.14509,1.18751,1.2302,1.28096,1.33447,1.39292,1.42863,1.43457,1.42989,1.40533,1.386,1.36199,1.34585,1.34354,1.35309,1.37641,1.41466,1.45801,1.50362,1.53126,1.56504,1.59421,1.61526,1.63145,1.64342,1.64155,1.6323,1.62084,1.62113,1.63061,1.65769,1.69393,1.74041,1.78074],"sx":[72.83,74.76,80.57,82.51,84.44,86.38,88.31,94.12,96.06,97.99,99.93,101.86,109.61,111.54,113.48,115.42,121.22,123.16,125.1,127.03,128.97,134.77,136.71,138.65,140.58,142.52,148.33,150.26,152.2,154.13,156.07,163.81,165.75,167.68,169.62,175.43,177.36,179.3,181.24,183.17,188.98,190.92,192.85,194.79,196.72,202.53,204.47,206.4,208.34,210.27,216.08,218.02,219.95,221.89,223.83,229.63,231.57,233.5,235.44,237.38,243.18,245.12,247.06,248.99,250.93,256.74,258.67,260.61,262.54,270.29,272.22,274.16,276.09,278.03,283.84,285.77,287.71,289.65,291.58,297.39,299.32,301.26,303.2,305.13,310.94,312.88,314.81,316.75,318.68,324.49,326.43,328.36,330.3,332.23,338.04,339.98,341.91,343.85,345.79,353.53,355.47,357.4,359.34,365.14,367.08,369.02,370.95,372.89,378.7,380.63,382.57,384.5,386.44,392.25,394.18,396.12,398.05,399.99,405.8,407.73,409.67,411.61,413.54,419.35,421.29,423.22,425.16,432.9,434.84,436.77,438.71,440.64,446.45,448.39,450.32,452.26,454.2,460.0,461.94,463.87,465.81,467.75,473.55,475.49,477.43,479.36,481.3,487.11,489.04,490.98,492.91,494.85,500.66,502.59,504.53,506.46,508.4,514.21,516.14,518.08,520.02,521.95,527.76,529.69,531.63,533.57,535.5,541.31],"sy":[960.46,960.42,960.42,960.55,960.68,960.69,960.71,960.64,960.57,960.49,960.28,959.95,959.65,959.42,959.25,959.37,960.03,960.81,961.69,962.53,963.73,964.96,965.85,966.25,966.27,966.19,965.92,965.52,964.95,964.35,963.75,963.27,962.82,962.53,962.59,963.62,965.86,968.85,973.09,978.0,982.23,986.4,989.43,992.28,995.16,999.49,1003.49,1008.02,1014.51,1020.31,1027.51,1034.19,1041.1,1047.67,1054.41,1061.28,1066.06,1068.79,1068.67,1067.2,1064.08,1060.19,1056.81,1053.27,1049.94,1045.36,1040.05,1033.68,1026.51,1019.33,1011.75,1004.74,998.28,991.86,986.18,981.89,978.22,975.13,972.25,969.37,966.75,963.88,961.26,959.53,958.44,957.65,957.27,956.95,956.38,955.72,955.52,956.04,956.78,957.57,957.73,957.76,957.38,956.96,956.54,955.92,954.94,953.86,952.75,951.64,950.46,949.07,947.76,946.06,944.03,942.14,940.65,940.83,941.88,943.3,944.54,945.77,946.98,948.3,949.56,950.67,952.23,953.82,955.9,957.92,959.56,960.77,961.55,961.74,961.79,961.62,961.49,961.19,961.03,960.72,960.16,959.6,959.03,958.35,957.63,956.85,956.38,956.3,956.36,956.69,956.95,957.27,957.48,957.51,957.39,957.07,956.56,955.98,955.37,955.0,954.55,954.16,953.88,953.67,953.51,953.53,953.65,953.81,953.8,953.68,953.32,952.83,952.21,951.67]}]} 2026-10-27T02:46:56.528820 image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 2020-01 2020-02 2020-03 2020-04 2020-05 2020-06 2020-07 2020-08 2020-09 Date (2020) 200 220 240 260 280 300 320 Price (dollars) 1. SPY's close, January to August 2020 SPY close 2020-01 2020-02 2020-03 2020-04 2020-05 2020-06 2020-07 2020-08 2020-09 Date (2020) 0 20 40 60 80 100 RSI (0 to 100) 2. RSI: below 30 in the crash, above 70 in the recovery RSI, 14 days 2020-01 2020-02 2020-03 2020-04 2020-05 2020-06 2020-07 2020-08 2020-09 Date (2020) 0 20 40 60 80 100 Stochastic (0 to 100) 3. Stochastic: pinned to 0 as every close is a new low %K, 14 days, from closes %D, 3-day average of %K 2020-01 2020-02 2020-03 2020-04 2020-05 2020-06 2020-07 2020-08 2020-09 Date (2020) −8 −6 −4 −2 0 2 PPO (% of the 26-day average) 4. PPO: the fast average's lead over the slow one, in percent PPO, 12/26-day signal, 9-day average of PPO

Traps

People thinkActually
RSI below 30 marks the bottomit marked 2020-02-28, three weeks before the low; the lines are where the index is stretched, not where it turns
%K at 100 means overbought, sellit means today’s close is the highest of 14 days, which a rising market does half the time
PPO and MACD are different signalsthe same gap, in percent against dollars; PPO reads across stocks and years, MACD does not
An oscillator predictseach one describes the last few weeks on a fixed scale; the forecast is the reader’s
RSI above 70 is a sellthe tests Kirkpatrick and Dahlquist report found the opposite rule, buying strength above 70 or 75, did better in rising markets
Three indicators agreeing is strong evidenceRSI and %K agree 0.85 of the time by construction; %K and PPO, 0.48, are closer to two opinions

The code

The snippet reproduces the three readings on 2020-03-16. Variables:

VariableHolds
pxSPY’s adjusted close, one row per trading day
gain, losseach day’s rise or fall in the close, the other one being zero
g, lWilder’s running average gain and average loss, one value per day
kstochastic %K from closes, one value per day
ppothe percentage price oscillator, one value per day
import pandas as pd

url = "https://raw.githubusercontent.com/ankurtrapasiya/examples/main/data/prices.csv"
px = pd.read_csv(url, index_col="date", parse_dates=True)["SPY"]
day = "2020-03-16"

change = px.diff()
gain, loss = change.clip(lower=0), (-change).clip(lower=0)
g, l = gain.iloc[1:15].mean(), loss.iloc[1:15].mean()   # Wilder's start: plain means of the first 14
for i in range(15, px.index.get_loc(day) + 1):          # then carry forward with weight 13, add today with weight 1
    g = (13 * g + gain.iloc[i]) / 14
    l = (13 * l + loss.iloc[i]) / 14
print(f"RSI {100 - 100 / (1 + g / l):.1f}")

w = px.loc[:day].iloc[-14:]                              # the last 14 closes, as the range
print(f"%K {100 * (w.iloc[-1] - w.min()) / (w.max() - w.min()):.1f}")

e12 = px.ewm(span=12, adjust=False).mean()               # span=n is the 2/(n+1) exponential average
e26 = px.ewm(span=26, adjust=False).mean()
print(f"PPO {100 * (e12[day] - e26[day]) / e26[day]:+.2f}%")

It prints an RSI of 30.1, a %K of 0.0 and a PPO of −6.05%. .ewm(span=n, adjust=False) is the pandas idiom for the recursive exponential average with the two-over-n-plus-one weight; it starts the chain from the first close rather than from a 26-day mean, which after a year of data makes no visible difference.

The script behind the real numbers

The tables and the chart come from examples/rsi-stochastic-ppo/oscillators.py, which runs on the blog’s five tickers. To run it yourself, clone the examples repo: its README has a three-command Docker setup, or run uv run rsi-stochastic-ppo/oscillators.py.

Summary

IdeaIn one lineOn SPY, 2020-03-16
An oscillator is bounded and smootheda fixed scale, so a reading means the same at any priceall three on their own scale while the price fell 11%
RSIaverage up-day over average down-day, 14 days, Wilder’s slow smoothing30.1; bottomed at 19.8 three weeks before the price low
Stochastic %Kwhere today’s close sits in the 14-day range0.0, a new low; above 80 on half of all days
PPOthe 12-day average’s lead over the 26-day, in percent−6.05%; last to recover, above zero again on 2020-04-16
Different arithmetic, partly different evidencethe pair that share least agree least%K and PPO correlate 0.48, RSI and %K 0.85

References

  • John J. Murphy, Technical Analysis of the Financial Markets (New York Institute of Finance, 1999). Chapter 10, “Oscillators and Contrary Opinion”, for the two problems an oscillator solves, the RSI formula and its 70 and 30 lines, failure swings, and the stochastic’s %K and %D with Lane’s observation about closes.
  • Steven B. Achelis, Technical Analysis from A to Z, 2nd edition (McGraw-Hill, 2001). The entries “Relative Strength Index”, “Stochastic Oscillator” and “Price Oscillator” for the origins, the four stochastic settings, and the price oscillator as a percentage of the shorter average.
  • Charles D. Kirkpatrick and Julie R. Dahlquist, Technical Analysis: The Complete Resource for Financial Market Technicians (FT Press, 2007). Chapter 18, “Confirmation”, for the definition of an oscillator and the warning about arbitrary levels, Wilder’s smoothing, the “RSI is wrong” method and the Bauer and Dahlquist and Thomas tests, the origin of the stochastic and its name, the MACD as a crossover variation, and why several price oscillators over one period are redundant.
  • StockCharts ChartSchool, Relative Strength Index (RSI), Stochastic Oscillator and Percentage Price Oscillator (PPO). The exact smoothing rules, the fast, slow and full stochastic settings, the PPO with the 26-day average in the denominator, and the warm-up note for the RSI.