Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/1336-standardlibrary-mathematics-stat-mathsubfunctions-statmathdifference.md
T
2026-06-23 21:47:51 +08:00

72 lines
1.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MathDifference
Generates an array with element differences of y[i]=x[i+lag]-x[i].
Version for a single generation of an array of real values:
```
bool  MathDifference(
   const double  &array[],     // array of values
   const int     lag,          // lag
   double        &result[]     // array of results
   )
```
Version for a single generation of an array of integer values:
```
bool  MathDifference(
   const int     &array[],     // array of values
   const int     lag,          // lag
   int           &result[]     // array of results
   )
```
Version for iterated generation of an array of real values (the number of iterations is set in the input parameters):
```
bool  MathDifference(
   const double  &array[],     // array of values
   const int     lag,          // lag
   const int     differences,  // number of iterations
   double        &result[]     // array of results
   )
```
Version for iterated generation of an array of integer values (the number of iterations is set in the input parameters):
```
bool  MathDifference(
   const int&    array[],      // array of values
   const int     lag,          // lag
   const int     differences,  // number of iterations
   int&          result[]      // array of results
   )
```
Parameters
array[]
[in] Array of values.
lag
[in] Lag parameter.
differences
[in] The number of iterations.
result[]
[out] Array to output the results.
Return Value
Returns true if successful, otherwise false.