Attachments forums

List of attachments posted on this forum.


All files on forums: 160903

Ag

ZigZag, Sun Aug 03, 2025 10:22 pm

Metatrader 5 ALGLIB library is one of the largest and most complete mathematical libraries, many its functions are related for neurals and machine learning but I coded something using its spline functionality - it might change a lot yet even today, since I am still testing and coding it, in the case someone interested to test.

https://www.mql5.com/en/code/1146

What Does the Indicator Do?

Momentum_Accelerator is an advanced oscillator that measures both market speed (momentum) and acceleration. Its main purpose is to filter out market noise and generate clear, intelligent signals about changes in market conditions. Basically it targets to warn you before market turns, it is not priceindicator in such a core sense peoble understand "oscillators".

The indicator operates in three main stages:

Price Normalization and Smoothing
It takes the raw price data, normalizes it to a 0–100 scale over a given period, and fits a mathematically precise cubic spline curve (using the ALGLIB library). This produces an extremely smooth, lag‑free version of the price.

Derivative Calculation
Based on this smooth price curve, it calculates two derivatives:

Velocity: The rate of price change. Shows how fast price is rising or falling.

Acceleration: The rate of change of velocity. Shows whether price movement is speeding up or slowing down.

Intelligent Signal Creation
It combines velocity, acceleration, and an optional trend filter to produce five different signal states that describe market dynamics (e.g., “strong accelerating uptrend” vs. “slowing uptrend that may anticipate a reversal”).

How Does It Visualize and Plot the Data?
The indicator uses two separate plot elements (#property indicator_plots 2) in its own window:

Blue Line (Plot 0 – “Smart Price”)

What it is: The value of the PriceBuffer, i.e., the normalized and spline‑smoothed price. A very clean representation of price movement, without the lag of traditional moving averages.

How it is drawn: DRAW_LINE plots it as a solid blue line, 2 pixels thick.

Smart Histogram (Plot 1 – “Smart Momentum”)

What it is: The most intelligent part of the indicator. A DRAW_COLOR_HISTOGRAM that visualizes two things simultaneously:

Bar Height comes from the MomentumBuffer and represents market velocity. Tall bars above zero = strong upward speed, tall bars below zero = strong downward speed.

Bar Color comes from the MomentumColorBuffer and represents acceleration and signal state, determined by the DetermineSignalStrength function.

Color meanings:

clrLimeGreen – Strong, accelerating uptrend

clrGreen – Uptrend is slowing down (possible exhaustion)

clrGray – No significant acceleration (“dead zone”)

clrRed – Downtrend is slowing (possible bottom forming)

clrDarkRed – Strong, accelerating downtrend

What Do the Input Modules Do?
The indicator’s functionality is divided into logical modules using input group definitions:

=== SPLINE & ADAPTIVITY ===
InpBaseSplinePeriod – Base period for spline calculation. Defines how many bars are used for the main curve. Longer = smoother but slower.

InpAdaptiveMode – Enables/disables adaptive period. If true, the indicator automatically adjusts InpBaseSplinePeriod according to market volatility (ATR).

InpAdaptivityFactor – Controls how aggressively the period adapts to volatility.

=== SMOOTHING & RESPONSIVENESS ===
InpSmoothingMethod – Selects smoothing method (e.g., EMA) used for derivative calculation.

InpSmoothingPeriod – Period of smoothing. Shorter = more sensitive velocity/acceleration.

InpDoubleSmoothing – Enables DEMA‑style double smoothing, further reducing lag.

=== SIGNAL INTELLIGENCE ===
InpSignalThreshold – Acceleration threshold. Defines how large a change must be to register as a signal (to exit the gray “dead zone”).

InpVelocityScale / InpAccelerationScale – Scaling factors for velocity and acceleration values, ensuring they are visually readable and comparable.

=== TREND FILTER ===
InpEnableTrendFilter – Enables/disables trend filter.

InpTrendFilterPeriod – Period of the moving average used to measure trend.

InpTrendStrength – Defines how strong the prevailing trend must be to affect signal strength. In weak trends, signal thresholds are raised to filter out uncertain signals.

=== VISUAL & ALERTS ===
InpEnableAlerts – Enables/disables popup alerts on signal changes.

InpShowInfoPanel – (Not implemented in this version, but reserved for future development).

InpPriceColor – Allows user to customize the color of the “Smart Price” line.
All files in topic