The 4 time frame stochastic indicator draws %K and %D in a pane under price, with lines at 20, 50 and 80. KPeriod, DPeriod and Slowing set the classic three number stochastic. The calculation reads whichever chart it is attached to, so the four chart view comes from running four charts side by side rather than from stacked readings in one pane.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Separate window (levels 20 / 50 / 80) |
| Plots | 2: %K, %D |
| Alerts | popup, push notification, email, sound |
| Inputs | 11 |
What the 4 Time Frame Stochastic Indicator draws on the chart
%K (lime) is the raw stochastic line after Slowing has been applied.
%D (red) is that line averaged over DPeriod bars.
Three levels cross the pane at 20, 50 and 80, matching the OverSold and OverBought defaults with a midline between them.
- %K: line, lime, width 2
- %D: line, red, width 1

How the 4 Time Frame Stochastic Indicator calculates its values
Where the two lines come from
Both lines are calls to the platform stochastic routine, using KPeriod, DPeriod and Slowing with simple averaging. One call asks for the main line and the other for the signal.
The raw reading measures where the close sits inside the high to low range of the last KPeriod bars. Slowing averages that figure before it reaches the plot.
The cross rule behind the alert
A buy needs three checks on closed bars. %K has to be at or below %D two bars back, above it one bar back, and still under OverSold plus ten.
That last part keeps the cross near the bottom of the pane. A sell asks for the mirror, with the line above OverBought minus ten.
How much history it reserves
The code adds KPeriod, Slowing and DPeriod together and pads the total by two bars. The loop stays clear of that region.
So the pane starts blank on the left. At the defaults that gap is a little over twenty bars.
How to read the signals
%K crossing above %D below the 20 line is the setup the alert rule looks for.
The mirror sits above 80, where the fast line crossing under its average matches the sell rule.
The 50 line splits the pane. Crosses that happen there carry none of the extreme context.
Both lines pinned near a boundary mean a strong move, not a turn about to happen.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
Alerts go out by popup, push, email and sound. The bar time is checked first, so one cross produces one alert per closed bar.
Every 4 Time Frame Stochastic Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
KPeriod |
KPeriod sets the high to low window the reading is measured against. It defaults to 14. | 14 |
DPeriod |
DPeriod averages the fast line into %D. It defaults to 3, and raising it slows every cross down. | 3 |
Slowing |
Slowing smooths the raw figure before plotting. It defaults to 3. Setting it to 1 gives the fast stochastic instead. | 3 |
OverBought |
OverBought is the upper boundary at 80. The sell check uses this value minus ten as its floor. | 80 |
OverSold |
OverSold is the lower boundary at 20. The buy check uses this value plus ten as its ceiling. | 20 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
master toggle. | on |
EnablePopup |
MT4 popup dialog. | on |
EnablePushNotify |
mobile MT4 push notification. | off |
EnableEmail |
SMTP email (Tools > Options > Email). | off |
EnableSound |
play sound file from MT4/Sounds/. | off |
SoundFile |
(see inputs panel) | alert.wav |

Settings that fit your chart
The screenshot uses EURUSD H1. A 14, 3, 3 setup suits pairs that rotate inside a range on H1 and H4, which is where the 20 and 80 lines get touched often. On daily charts the same settings turn over slowly and a cross can take a week to appear. Running the same file on M15, H1, H4 and daily gives the four chart picture the name points at.
When the 4 Time Frame Stochastic Indicator fails
A trend pins the fast line near a boundary for a long run. Every cross against that trend looks like a signal while price keeps going.
The alert window of ten points either side of OverSold and OverBought is fixed in the rule. Widening OverSold moves the whole window with it, which is easy to miss.
Slowing at 3 hides small swings in the raw reading, so a quick reversal can show up as one flat stretch instead of a cross.
The 50 line is drawn but no rule uses it. Crosses there mean nothing to the alert block.
Copy the compiled 4 Time Frame Stochastic Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Background reading on the method behind the 4 Time Frame Stochastic Indicator: Stochastic oscillator on Wikipedia, Stochastic Oscillator Fast Slow And Full at StockCharts ChartSchool.
Download the 4 Time Frame Stochastic Indicator for MT4 and MT5
The zip holds the compiled 4 Time Frame Stochastic Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
Does this plot four time frames at once in the pane?
No. The calls read whichever chart the file sits on, so one instance gives one reading. To get four time frames, open four charts and attach the same file to each of them. The pane shows %K and %D for that chart alone, at whatever period it is set to.
What does Slowing at 3 change about the %K line?
Slowing averages the raw figure before it reaches the plot. At 3 it takes the edge off single bar spikes. Set it to 1 and you get the fast stochastic, which crosses its average far more often. Higher values make both lines glide instead of jump.
Why does the buy check use OverSold plus ten rather than 20?
The rule wants the cross to happen near the bottom of the pane, but not exactly on the line. Adding ten to OverSold gives a band from 20 up to 30 where a cross still counts. Raising OverSold moves that whole band up along with it.
How long is the blank stretch before %K appears?
The code reserves KPeriod plus Slowing plus DPeriod, then pads it by two bars. At the defaults of 14, 3 and 3 that leaves 22 bars with no values on them. Raising any of the three pushes the first plotted point further to the right.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the 4 Time Frame Stochastic Indicator as one input. Always backtest before trading live.
Category: this is part of our Oscillators collection. Next, browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- The core method is documented in Stochastic oscillator on Wikipedia.
- Additional market context is at Stochastic Oscillator Fast Slow And Full at StockCharts ChartSchool.
