Unisciti alla nostra fan page
Statistical Functions - libreria per MetaTrader 5
- Visualizzazioni:
- 9212
- Valutazioni:
- Pubblicato:
- 2015.05.27 17:09
- Aggiornato:
- 2016.11.22 07:32
- Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance
Set of statistical functions which allows you to calculate some values describing timeseries like correlation between two time series, linear regression, standard deviation etc. It includes also more advanced functions like definite integral.
Header file "Statistics.mqh" includes following functions:
Syntax | Description | Return type |
---|---|---|
mean(T &arr[]) | Mean | (generic) |
std(double &arr[]) | Standard deviation | double |
correlation(&arr1[], &arr2[]) | Correlation coefficient | double |
detrend(arr[], resultArray[]) | Timeseries decomposition | void |
regression(&arr1[], &arr2[], &res[]) | Regression line | void |
regression(double &arr1[], double &arr2[], double &res[], double &aCoeff,double &bCoeff) | Regression line with coefficients | void |
dickeyFuller(double &arr[]) | Dickey-Fuller test for stationarity | bool |
engleGrangerTest(double &arr1[], double &arr2[],double &cointCoeff) | Engle-Granger 2-step method for testing cointegration | bool |
AR1(double &arr[]) | Autoregressive model with lag 1 | double |
signedIntegral(double a, double b, int n) * | Definite integral | double |
erf(double x) | Error function | double |
normDistZ(double z) | Probability that variable is from normal distrbution | double |
* You should add your own implementation of "foo" function which you want to integrate. Default function is: f(x) = x.
You should also remember that timeseries avaliable in MQL are indexed in a way that the newest data have a 0 index. It's a good idea to reverse the order of such arrays and is absolutely necessay in AR model (arrays are not reversed inside of the method to avoid confusion).
Semaphore signal indicator triggering when the BinaryWave indicator changes direction.
StochasticTrend_x10The StochasticTrend_x10 indicator shows the Stochastic oscillator position from ten different timeframes.
The indicator shows correlation between currencies.
StocksBGStocksBG indicator displays the activity of major stock exchanges on a chart with M15 or less timeframe.