• Overview
  • Reviews
  • Comments (12)
  • What's new

MA Corrector

A very important function that is responsible for accurate entry and and exit is implemented as an indicator that passes 15 parameters via buffers.

Despite all its shortcomings, THE ma IS successfully used IN MY Expert Advisors for opening and closing positions. We fix shortcomings - this is the main purpose of the function described; and use its benefits.

  • The first disadvantage of MA is lagging. To fix it, we use an oscillator type indicator combined with the level indicator. If the price breaks the support/resistance level, and the oscillator shows the price growth/fall level that exceeds the Differ_Fly constant, an alternative opening signal that ignores the MA signals is formed (see. Pic.3).

  • The second disadvantage of MA used for closing is false signals with a relatively small averaging and low volatility. Can be fixed by calculating the average volatility level on a short interval and forming a signal to prohibit closing or change MA closure parameters (see. Pic.4, Pic.5).

In addition, the indicator provides other data that can be used to automatically change the opening levels of limit orders when the maximum volatility on a long interval changes, to automatically change Trailing Stop parameters, etc.

The indicator operation is shown as an Expert Advisor that uses this function. The performance of this EA is shown in the first comment to my previous product Double MA, which is also part of the EA and is used to determine the general trend and form the buy/sell signals, and also (with other settings) to generate closure signals.

Interface

Constant Purpose
InfoOn Disable information text display on chart.
LinesShow Disable drawing of level lines.
TF The common timeframe for the 2 indicators of levels and the "Middle Trend" oscillator. Default is H1. Not recommended below.
Long_Bars The number of bars to calculate in the "long" indicator of levels.
Long_Shift Offset from the current bar, leaving a "hole" for the price without changing the level.
Long_DifferAverVolatility A constant for comparison with the actual average volatility.
Long_DifferMaxVolatility A constant for comparison with the actual maximum volatility.
Short_Bars The number of bars to calculate in the "short" indicator of levels.
Short_Shift Offset from the current bar, leaving a "hole" for the price without changing the level.
Short_DifferAverVolatility A constant for comparison with the actual average volatility.
Short_DifferMaxVolatility A constant for comparison with the actual maximum volatility.
Differ_Mid A constant for comparison with the actual level produced by the "Middle Trend" oscillator.
Differ_Fly A constant for the fixing the level of the high-speed price breakdown.
Bars_Mid The number of bars for calculation of the "Middle Trend" indicator.
Shift_Mid Offset from the current bar. Default is 0, the indicator responds instantly to both the news and price spikes.
TF_Mini The timeframe of the "Mini Trend" indicator. Default is 15 minutes (it is the recommended timeframe).
Differ_Mini A constant for comparison with the actual level produced by the "Mini Trend" oscillator.
Bars_Mini The number of bars for calculation of the "Mini Trend" indicator.
Shift_Mini Offset from the current bar. Default is 0, the indicator responds instantly to both the news and price spikes.

The list of indicator buffers

  • SetIndexBuffer(12,bClose);
  • SetIndexBuffer(13,sClose);
  • SetIndexBuffer(14,CloseBan);
Buffer # The purpose of the parameter
0 Price high in the long interval of the levels indicator.
1 Price low in the long interval of the levels indicator.
2 Price high in the short interval of the levels indicator.
3 Price low in the short interval of the levels indicator.
60 Price movement maximum in the long interval.
5 The average value of price movement in the long interval.
6 Price movement maximum in the short interval.
7 The average value of price movement in the short interval.
8 The actual level of price growth/fall produced by the "Middle Trend" oscillator.
9 The actual level of price growth/fall produced by the "Mini Trend" oscillator.
10 An alternative BuySignal formed when the "Middle Trend" oscillator exceeds FlyLevel and the high of the long interval is broken.
11 An alternative SellSignal formed when the "Middle Trend" oscillator exceeds FlyLevel and the low of the long interval is broken.
12 A signal to close a buy position formed by "Middle Trend" when trend changes to opposite. Can be used independently (closing of extreme positions when pyramiding), and in combination with other indicators.
13 A signal to close a sell position formed by "Middle Trend" when trend changes to opposite. Can be used independently (closing of extreme positions when pyramiding), and in combination with other indicators.
14 CloseBan. A signal prohibiting MA to close positions during low volatility, or to be used as a signal to change the MA closure parameters.

If you have any questions, please feel free to write to me, I'll provide further explanations in the comments.

No reviews
Version 1.1 - 2015.03.23
Information output is more convenient and easier-to-understand.
Modification is intended for those using this indicator for manual trading.