Best Stochastic Settings: 2,700 Tests of K/D and Smoothing
Test 2,700 USD/JPY stochastic runs: compare K/D periods, smoothing and 20/80 fades, with win rates, annual transfers and spread costs on the 1-hour chart.
The stochastic oscillator measures where the close sits within a recent high/low range. Its K and D lines appear below the price chart. Traders can read the 20/80 levels or trade crosses between the lines, but those rules take different positions and need separate tests.
Searching for the best stochastic settings for a 1-hour chart also requires separating the K lookback from K smoothing. A longer lookback changes the range being measured; more smoothing averages the individual K readings. The D period controls another average of K.
Across 2,700 USD/JPY runs, 43 of 75 hourly crossover settings were profitable in both years. All 15 K/D combinations with smoothing set to 20 were profitable in both years. Short fades produced no settings profitable in both years on any tested timeframe.
How the stochastic oscillator calculates K and D
Raw K subtracts the lookback's lowest low from the current close, divides by the lookback's highest high minus lowest low, and multiplies by 100. A close near the top of that range produces a reading near 100; a close near the bottom produces a reading near 0.
The definition tested here takes a simple average of the individual raw K readings over the smoothing period. That average is the displayed K line. D is a further simple average of the displayed K values. If the lookback has identical highs and lows, the raw reading is set to 50.
A reading above 80 describes the close's position. It does not establish that price has started falling. An advance can keep closing near its recent highs, leaving K elevated while a short position loses money.
Stochastic settings: K period, D period and smoothing
Adding Stochastic from Formiq's indicator list draws the lines in a separate pane below the candles. The calculation and level fields are:
| Field | Default | Meaning |
|---|---|---|
| K period | 14 | Bars used to find the highest high and lowest low |
| D period | 3 | Number of smoothed K values averaged for D |
| Slowing | 3 | Number of raw K values averaged; called K smoothing in this article |
| Upper level | 80 | Upper guide drawn in the pane |
| Lower level | 20 | Lower guide drawn in the pane |
K is yellow by default and D is blue. Line colors and width can be changed without changing the calculation. The pane includes the 20 and 80 guides. Chart guides and backtest trading levels are configured separately.
14/3/3 means K lookback / D period / K smoothing, in that order. Smoothing of 1 leaves raw K unchanged. A longer smoothing period averages over more readings. Increasing D smooths the D line without changing K.
The tested entry and exit rules were:
| Trading rule | Entry | Exit |
|---|---|---|
| Long fade | Buy while K is below 20 | Close when K exceeds 80 |
| Short fade | Sell while K exceeds 80 | Close when K falls below 20 |
| K/D cross | Buy when K crosses above D; sell when K crosses below D | Close on the opposite cross |
The fades enter while K is outside a level; they do not wait for K to return inside the band. Crosses require an actual intersection and have no 20/80 restriction. Long and short fades were run independently, not combined into one portfolio.
How this was measured
All trading results were measured with Formiq's backtesting engine.
| Item | Setting |
|---|---|
| Pair | USD/JPY |
| Main period | 2025-01-01 to 2025-12-31 |
| Separate-year check | 2024-01-01 to 2024-12-31 |
| Within-year checks | 2025-01-01 to 06-30 and 2025-07-01 to 12-31, each run independently |
| Timeframes | 15-minute, 1-hour, 4-hour |
| K lookbacks | 5, 9, 14, 21, 50 |
| K smoothing periods | 1, 3, 5, 10, 20 |
| Crossover D periods | 2, 3, 5 |
| Fade level pairs | 10/90, 20/80, 30/70; D held at 3 |
| Run count | 75 settings per trading rule; 3 rules × 3 timeframes × 4 periods = 2,700 runs |
| Exit | Opposite cross for crossovers; opposite level for fades; remaining positions closed at period end |
| Execution and costs | Candle close, fixed 0.3-pip spread, zero slippage |
| Position size | 0.1 lot |
| Stops and targets | Off in the main sweep; tested separately |
Varying D would duplicate level-only settings, so those duplicates were excluded. Net pips were calculated from entry and exit prices. Extra filter, stop, target and spread runs are outside the 2,700-run count.
Does slower smoothing stop K reaching 20 and 80?
With K lookback 14 and D period 3, the 1-hour series contained 6,226 valid bars in 2025. The table counts bars outside each threshold.
| K smoothing | Bars below 20 | Bars above 80 | Share below 20 | Share above 80 |
|---|---|---|---|---|
| 1 | 1,238 | 1,534 | 19.88% | 24.64% |
| 3 | 1,091 | 1,480 | 17.52% | 23.77% |
| 5 | 969 | 1,323 | 15.56% | 21.25% |
| 10 | 689 | 1,022 | 11.07% | 16.42% |
| 20 | 280 | 512 | 4.50% | 8.22% |
Increasing smoothing from 1 to 20 reduced the number of bars below 20 from 1,238 to 280. Smoothing of 20 still reached both thresholds, so a longer smoothing period did not make 20/80 unreachable in this sample.
These are bar counts, not entry counts. Several consecutive bars can remain outside a threshold, and bars reached while a position is open do not create another trade.
Which timeframe stayed profitable across years?
Each trading rule has 75 distinct settings. A setting with no trades and zero net pips is not counted as profitable.
| Timeframe | Trading rule | Profitable in 2024 | Profitable in 2025 | Profitable in both | 2025 median net (pips) |
|---|---|---|---|---|---|
| 15-minute | K/D cross | 2/75 | 4/75 | 1/75 | −2,190.0 |
| 15-minute | Long fade | 28/75 | 17/75 | 11/75 | −712.6 |
| 15-minute | Short fade | 0/75 | 16/75 | 0/75 | −662.4 |
| 1-hour | K/D cross | 49/75 | 52/75 | 43/75 | +834.5 |
| 1-hour | Long fade | 42/75 | 36/75 | 26/75 | 0.0 |
| 1-hour | Short fade | 2/75 | 35/75 | 0/75 | −145.5 |
| 4-hour | K/D cross | 62/75 | 67/75 | 56/75 | +1,143.7 |
| 4-hour | Long fade | 29/75 | 59/75 | 18/75 | +643.2 |
| 4-hour | Short fade | 1/75 | 56/75 | 0/75 | +560.7 |
The 15-minute crossover's 2025 median was −2,190.0 pips, compared with +1,143.7 pips on the 4-hour chart. The direction of a fade also matters: no short-fade setting was profitable in both years on any timeframe.
Splitting 2025 into halves left 54 of 75 hourly crossover settings profitable in the first half and 44 in the second. Annual profitability does not describe every part of the year. Because each run closes remaining positions at its own end date, adding the independent half-year results does not exactly reproduce the annual result.
Should you increase smoothing on the 1-hour chart?
Each row holds the same five K lookbacks and three D periods, changing only K smoothing. The annual means below are averages across 15 settings, not the return of a combined trading account.
| K smoothing | Profitable in both | 2024 mean annual net (pips) | 2025 mean annual net (pips) |
|---|---|---|---|
| 1 | 2/15 | −1,121.3 | −1,347.3 |
| 3 | 6/15 | −391.9 | +492.3 |
| 5 | 8/15 | +592.7 | −40.5 |
| 10 | 12/15 | +2,061.8 | +1,295.9 |
| 20 | 15/15 | +3,443.8 | +1,744.1 |
Settings profitable in both years increased from 2 with smoothing 1 to 15 with smoothing 20. The 2025 mean did not improve at every step: smoothing 3 produced +492.3 pips, while smoothing 5 produced −40.5 pips.
Long fades had the most two-year profitable settings at smoothing 5
For fades, each row combines five K lookbacks with three level pairs. D stays fixed because the entry and exit rules do not use it.
| K smoothing | Profitable in both | 2024 mean annual net (pips) | 2025 mean annual net (pips) |
|---|---|---|---|
| 1 | 2/15 | −225.3 | −745.9 |
| 3 | 3/15 | −57.9 | −387.7 |
| 5 | 8/15 | +217.0 | −186.3 |
| 10 | 7/15 | +258.5 | +347.9 |
| 20 | 6/15 | +231.1 | +369.6 |
Long fades had 8 settings profitable in both years at smoothing 5, versus 6 at smoothing 20. The hourly crossover's result at smoothing 20 therefore does not transfer directly to a level fade.
Short fades had no settings profitable in both years at any smoothing period:
| K smoothing | Profitable in both | 2024 mean annual net (pips) | 2025 mean annual net (pips) |
|---|---|---|---|
| 1 | 0/15 | −1,833.6 | −657.6 |
| 3 | 0/15 | −1,630.1 | −318.9 |
| 5 | 0/15 | −1,338.3 | −113.9 |
| 10 | 0/15 | −1,184.6 | +301.6 |
| 20 | 0/15 | −941.4 | +201.6 |
Default 14/3/3 turned negative on the hourly chart
The default K/D crossover, separated by timeframe and year:
| Timeframe | Year | Trades | Win rate | Annual net (pips) |
|---|---|---|---|---|
| 15-minute | 2024 | 6,136 | 37.24% | −1,547.6 |
| 15-minute | 2025 | 6,051 | 38.13% | −1,661.5 |
| 1-hour | 2024 | 1,525 | 38.36% | +686.6 |
| 1-hour | 2025 | 1,510 | 37.35% | −49.7 |
| 4-hour | 2024 | 359 | 43.18% | +3,093.0 |
| 4-hour | 2025 | 383 | 42.82% | +2,959.6 |
The hourly 14/3/3 cross made money in 2024 but lost 49.7 pips in 2025. The same periods were profitable in both years on the 4-hour chart. A period recommendation needs to specify the timeframe it was tested on.
Did the previous year's best setting beat the next year's median?
For each timeframe, the setting with the highest annual net pips was applied unchanged to the other year. Selecting in 2024 and testing in 2025 is the forward check. Selecting in 2025 and looking back at 2024 checks historical consistency; it is not a forward prediction.
| Timeframe | Selection year | K/D/smoothing | Selection-year net (pips) | Test year | Trades | Test-year net (pips) | Test-year median (pips) |
|---|---|---|---|---|---|---|---|
| 1-hour | 2024 | 21/3/20 | +5,095.2 | 2025 | 657 | +1,920.5 | +834.5 |
| 1-hour | 2025 | 14/3/20 | +3,211.3 | 2024 | 745 | +3,323.9 | +799.4 |
| 4-hour | 2024 | 50/3/5 | +4,481.9 | 2025 | 263 | +598.0 | +1,143.7 |
| 4-hour | 2025 | 21/5/10 | +3,354.8 | 2024 | 175 | −1,686.5 | +1,857.5 |
On the hourly chart, the 2024 winner, 21/3/20, earned +1,920.5 pips in 2025 and exceeded that year's +834.5-pip median. On the 4-hour chart, the 2024 winner, 50/3/5, returned +598.0 pips in 2025, below the +1,143.7-pip median.
The 4-hour setting with the highest 2025 net, 21/5/10, lost 1,686.5 pips when applied to 2024. Searching many settings makes the largest observed profit a selected result, which is why the other-year figures are shown alongside it.
A win rate above 60% still left both fades negative
The comparison below uses the 1-hour chart in 2025, periods 14/3/3 and fade levels 20/80.
| Trading rule | Trades | Win rate | Average win (pips) | Average loss (pips) | Annual net (pips) |
|---|---|---|---|---|---|
| K/D cross | 1,510 | 37.35% | +32.72 | −19.56 | −49.7 |
| Long fade | 106 | 60.38% | +46.83 | −85.05 | −574.9 |
| Short fade | 107 | 61.68% | +53.62 | −98.85 | −513.9 |
The long fade won 60.38% of 106 trades, but its average winner was +46.83 pips against an average loser of −85.05 pips. Those larger losses left annual net at −574.9 pips. The short fade also lost money despite winning 61.68% of 107 trades.
Long-only and short-only trades are exposed differently to the market's direction. Profitable long-fade settings alone do not establish that the stochastic threshold predicted a reversal beyond that exposure.
Could filters or stops reduce the losses?
The following variants use the hourly 14/3/3 crossover. ADX uses period 14 with no directional requirement and filters entries only. Exits still use the opposite K/D cross. The time restriction also applies only to new entries.
| Added condition | Year | Trades | Annual net (pips) |
|---|---|---|---|
| No added condition | 2024 | 1,525 | +686.6 |
| No added condition | 2025 | 1,510 | −49.7 |
| ADX ≥ 20 | 2024 | 1,005 | +355.7 |
| ADX ≥ 20 | 2025 | 1,007 | +136.3 |
| ADX ≥ 25 | 2024 | 698 | +194.0 |
| ADX ≥ 25 | 2025 | 705 | +639.6 |
| 08:00–16:00 UTC | 2024 | 524 | −360.9 |
| 08:00–16:00 UTC | 2025 | 520 | +1,132.3 |
| 30-pip stop / 60-pip target | 2024 | 1,351 | −620.9 |
| 30-pip stop / 60-pip target | 2025 | 1,327 | −1,622.4 |
| 100-pip stop / 200-pip target | 2024 | 1,505 | +356.4 |
| 100-pip stop / 200-pip target | 2025 | 1,503 | −41.5 |
An ADX threshold of 25 produced +639.6 pips over 705 trades in 2025, but reduced 2024 net compared with the unfiltered rule. The UTC session filter turned 2025 positive while turning 2024 negative. Showing only the improved year would give a different account of the filter.
A 30-pip stop and 60-pip target left both years negative. An opposite cross can close a position before its stop or target is reached. If one candle touches both the stop and target, the stop takes precedence.
A 0.3-pip spread erased the default crossover's gross profit
These are 2025 annual results for hourly 14/3/3. Spread and net profit are both expressed in pips.
| Trading rule | Trades | Annual net, spread 0 | Annual net, spread 0.3 | Annual net, spread 1.0 |
|---|---|---|---|---|
| K/D cross | 1,510 | +403.4 | −49.7 | −1,106.7 |
| Long fade | 106 | −543.1 | −574.9 | −649.1 |
| Short fade | 107 | −481.8 | −513.9 | −588.8 |
The crossover earned +403.4 pips at zero spread. Charging a 0.3-pip spread across 1,510 trades left −49.7 pips. Its break-even spread was 0.27 pips when displayed to two decimal places; that displayed value is not a guarantee that a spread of exactly 0.27 remains profitable.
The long and short fades were already negative at zero spread. Transaction costs cannot account for their losses on their own.
Related
- Stochastic RSI settings: applying a range calculation to RSI instead of price
- RSI periods and threshold tests: separating level fades from crosses
- Moving average disparity settings: measuring threshold reach before trading it
Notes
The sample covers USD/JPY in 2024 and 2025, with candle-close fills and fixed spreads. Variable spreads, execution differences and swap charges are excluded. Pre-start candles are provided for indicator calculation, and positions still open at each period's end are closed. Calculation needs enough history for K, smoothing and D, plus earlier values to identify a cross.
Questions people ask
- What are the best stochastic settings for a 1-hour chart?
- In this USD/JPY test, K/D crosses produced positive net pips in both 2024 and 2025 for 43 of 75 settings. With K smoothing set to 20, all 15 K/D period combinations were profitable in both years. The test does not establish the best setting for future prices or other markets.
- What is the difference between K, D and smoothing?
- K sets the high/low lookback. Smoothing averages the raw K values, while D averages the smoothed K line. A level-only rule never reads D, so changing D does not change that trading condition.
- Does a high stochastic win rate mean the strategy is profitable?
- No. On the 1-hour chart in 2025, the 14/3/3 long fade won 60.38% of 106 trades but lost 574.9 pips. Its average win was 46.83 pips and its average loss was 85.05 pips.
- Did the default 14/3/3 crossover make money?
- On the 1-hour chart, 14/3/3 returned +686.6 pips over 1,525 trades in 2024 and −49.7 pips over 1,510 trades in 2025, with a fixed spread of 0.3 pips. It was not profitable in both years.
Formiq is a free browser-based FX terminal with replay practice and no-code backtesting. Open the chart or see what the free plan includes.