Search This Blog

Monday

Indicator Fractial Period


This forex indicator does not differ across the fields of parameters, the smoothing method and the types of prices from the standard iMa , but allows the use of fractional period and shift.
double iCustom ( 
string symbol, //  string symbol, / / character name tool (NULL-current)
int timeframe, //  time-frame (0 - current)
"iFMA" , //  name of this indicator
 double period, / / period MA; m.b.drobnym (> 1) and in the form of ratio-ta (<1)
 double ma_shift, / / shift MA;  fractional (0)
int ma_method, / / method of averaging:
// 0 - SMA (simple)
// 1-  EMA (exponential)
// 2 - SSMA (smoothed)
// 3 - LWMA (linearly-weighted)
int applied_price, //  type of smoothed data:
// 0 - Close, 1 - Open, 2 - High, 3 - Low,
// 4 - Middle = (High + Low) / 2 (medium)
// 5 - Typical = (High + Low + Close) / 3 (typical)
// 6 - Weighted = High + Low +2 * Close) / 4 (weighted)
// 7-  Volume (volume)
0 , //  mode - buffer number indicator (0)
 int shift / / shift
   ) ) 
It features a field type and period ma_shift (double instead of int) and added a modifier for the field applied_price - 7 (volume).
In addition, the added possibility rather than the period entered the coefficient (> 0 ... <1), which allows fully matched to EMA .  For example, initially MACD on DiNapoli use coefficients for the fast and slow EMA , which very roughly translated to periods in MT due to their integer.  Options MACD DiNapoli: fast EMA - ratio.  0,213 - the period of 8.39, slow - 0.108 - 17.52, whereas in the MT are given by periods of 8 and 17, respectively.
If we introduce the coefficient of the other averaging method, it will be counted in the period.  And since the period may be in this forex indicator nonintegral, then the MA will be calculated based adequately in any case - or a non-integral period obtained from the conversion.  So it is absolutely unimportant, you enter in the field MAperiod, say, a factor of 0.1 or a period of 19 - the same result.
The picture shows the SSMA (3) - red, SSMA (3.6) - Green, SSMA (2.33) - blue.
Forex indicators

  Note that for SSMA (3) instead of period 3 introduced a coefficient of 0.5, which was successfully converted into the period and displayed in the window of data.  This, of course, taken as an example of the use of factors other than those types of EMA MA. Можно (и логичней) для SSMA было ввести 3 с тем же результатом. You can (and logical) for the SSMA to be introduced in March with the same result.
By the way, SSMA - smoothed moving average (on another are called "smoothing Wilder" - Wilder's smoothing) absolutely painlessly may be replaced by ordinary EMA, which is calculated as the period 2 * Period SSMA -1.  That is, SSMA (12) will be exactly the same as the EMA (23) at a sufficient history (> 4 periods).

Download forex indicator Fractial Period

No comments: