ChangePoint.mqh는 Adams와 MacKay(2007)의 베이지안 온라인 변화점 탐지 기법을 사용하여 시계열의 평균 또는 변동성이 변화하는 순간을 실시간으로 감지합니다. 시계열은 각각 고유한 평균과 분산을 가진 구간들로 간주되며, 새로운 구간은 어떤 막대(bar)에서든 시작될 수 있습니다. 각 값을 산출한 후, 이 클래스는 모든 런 길이(마지막 변화 이후의 바 수)에 대한 확률을 제공하므로, 지난 k 바 동안 변화가 발생했을 확률, 현재 세그먼트의 가장 유력한 시작점, 그리고 다음 값에 대한 예측치를 확인할 수 있습니다. 이 기능은 바 단위로 작동하므로(업데이트), Expert Advisor나 지표가 새로운 바가 생성될 때마다 이 기능을 호출할 수 있습니다. DLL이 필요하지 않습니다.
#include <ChangePoint\ChangePoint.mqh> CChangePoint cp; cp.Prior(0.0, 0.1, 2.0, 1.0); // segment mean around 0, variance around 1 (beta / (alpha - 1)) cp.Hazard(250.0, 1e-12); // a change every 250 bars on average; drop run lengths below 1e-12 // at each new closed bar: double ret = 0.0; // for example 100 * log(close[1] / close[2]) cp.Update(ret); double p = cp.ChangeWithin(10); // probability that the current segment is younger than 10 bars int run = cp.MostLikelyRun(); // bars since the most likely last change double next = cp.PredictiveStd(); // standard deviation of the next value
ChangePointProbability.mq5 지표는 별도의 창에 지난 k 바 이내의 변화 확률을 표시하며, 이 확률은 해당 바까지의 수익률을 기반으로 마감된 바마다 한 번씩 계산됩니다. 스크립트 ChangePointExample.mq5는 특정 종목의 수익률에 대해 감지기를 실행하고, 발견된 변화(새로운 세그먼트가 몇 바 동안 지속되면 변화가 보고됨)를 발견된 변화 전후의 변동성 및 현재 상태와 함께 나열합니다(그림 1). 금 D1 차트에서 이 스크립트는 2025년 4월의 변동성 급등과 2026년 초의 변동폭을 감지합니다(그림 2).


ChangePoint.mqh는 MQL5\Include\ChangePoint에, ChangePointExample.mq5는 MQL5\Scripts\ChangePoint에, ChangePointProbability.mq5는 MQL5\Indicators\ChangePoint에 저장합니다.
MetaQuotes Ltd에서 영어로 번역함.
원본 코드: /en/code/78905
Copula: Gaussian, Student t, Clayton, Gumbel and Frank copulas with tail dependence
순위에 대한 5가지 이변량 코풀라를 적합시키며, 켄달의 타우, 꼬리 의존성, 공동 극값 발생일 확률, AIC 및 쌍별 거래의 조건부 확률을 포함합니다.
GotobiDays - include file to find Gotobi days (Japanese payment dates)
Include file with small functions to find the Gotobi days: the 5th, 10th, 15th, 20th, 25th and the last day of each month, moved back to the previous business day when they fall on a weekend or a holiday you list. Information only, no trading functions.
Account Recorder - balance, equity and day drawdown to CSV every minute (service)
A service that writes your balance, equity, floating result, margin and the drawdown from today's highest recorded equity to a CSV file every minute. Runs without a chart and never trades.
Export Closed Trades to CSV with a summary per magic number
Saves the closed trades of your MT5 account history to a CSV file, one row per trade, plus a second file with totals for each magic number.