Loading…

Price Acceleration Oscillator

Most momentum oscillators plot the first derivative of price: how fast price is currently moving. That is useful, but it turns at the same moment the move itself turns, which is often later than a trader would like. Acceleration - the rate of change of that momentum - turns first, the same reason a car's speedometer can already be falling while the car is still moving forward: the driver lifted off the gas before the car actually slowed to a stop. This indicator smooths price with a moving average first, then takes that smoothed line's second difference (today's change in velocity, compared with yesterday's change in velocity). Smoothing before differencing twice is what makes the result usable - a raw unsmoothed second difference of price is almost entirely noise, since ordinary tick-to-tick price wiggle already dominates the first difference before a second difference is even taken. The histogram is split into two buffers (green for positive acceleration, red for negative) since plain MQL4 indicators have no colour-changing single-line plot type. Notes and limitations - Needs InpSmoothPeriod + 3 bars of history before it plots anything. - Acceleration crossing zero is not the same as momentum crossing zero, and neither is the same as price changing direction - all three can happen at different bars. Treat an acceleration flip as an early warning that the current move may be losing strength, not as a standalone entry or exit signal. - Because it is a second difference of a smoothed line, it lags the smoothing period's own settling time - a freshly changed InpSmoothPeriod needs a few bars before the acceleration reading fully reflects the new smoothing.

Indicator · MT4 · v1.0 · Free

About Price Acceleration Oscillator

Price Acceleration Oscillator is an indicator for MetaTrader 4 based on Moving Average. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Smooth period, Smooth method and Applied price. MQL source code included.

Files in the download: PriceAccelerationOscillator.mq4, PriceAccelerationOscillator.txt.

Settings

SettingDefaultWhat it does
Smooth period10Period of the moving average applied to price before differencing
Smooth methodMODE_EMAMoving average method used to smooth price
Applied pricePRICE_CLOSEPrice series the moving average is applied to
AlertstrueAlert once per closed bar when acceleration crosses zero

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Momentum · Oscillator · Alerts · Moving Average · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria