Discussing the article: "Distribution-Free Price Channels in MQL5: Quantile Regression by Iteratively Reweighted Least Squares"

 

Check out the new article: Distribution-Free Price Channels in MQL5: Quantile Regression by Iteratively Reweighted Least Squares.

We build a rolling price channel by fitting the 0.1, 0.5 and 0.9 conditional quantile lines via IRLS with pinball loss, packaged as a reusable class and two MetaTrader 5 indicators. We verify in-sample coverage, examine quantile crossing, and compare the channel width with ATR, Bollinger and regression widths on matched horizons. Tests in the Strategy Tester show the edges are descriptive, while the normalized width works as a volatility/regime feature.

Almost every price channel a trader draws rests on the same two numbers: a mean and a standard deviation. A regression channel fits a line through the average of the window and offsets its edges by a fixed multiple of the residual standard deviation; a Bollinger band does the same around a moving average. Both inherit an assumption that is rarely stated out loud: that price around its trend is distributed symmetrically, and that a standard deviation is a meaningful description of how far it strays. Real price is neither. Its dispersion is driven by a handful of large bars that inflate the standard deviation, and its excursions above and below the trend are frequently uneven.

In this article we build a channel that makes none of those assumptions. Instead of fitting the mean of the window and measuring a standard deviation, we fit three conditional quantile lines directly: the 0.1, 0.5 and 0.9 quantiles of price as a function of position in the window. Each is fitted independently by minimising a loss function called the pinball loss, using a compact routine called iteratively reweighted least squares (IRLS). The result is a distribution-free channel that never computes a standard deviation, never assumes normality, and is free to be asymmetric where the data is. You will learn how that fit works and how to package it into a reusable class and two MetaTrader 5 indicators. Then we test it: whether the three lines really split the window in the proportions their quantile names promise, how the width compares against the Bollinger width, ATR and regression width on the same lookback, and how a deliberately naive Expert Advisor behaves in the Strategy Tester across four instruments.

The pinball loss for three quantile levels

Author: Adedayo David Gbadebo