MA Bounce Strategy Indicator
There is an indicator which can help to identify and find place for potential market entry by MA bounce strategy.
Indicator can be downloaded by this links:
MA Bounce Strategy Indicator is well complemented with Trend Power indicator:
MA Bounce Strategy description: https://www.mql5.com/en/blogs/post/743037.
MA Bounce Strategy Indicator User Guide
This article is a User Guide for MA Bounce Strategy Indicator. It describes all its parts and parameters.
MA Bounce Strategy Indicator contains five parts:
- Trend identification;
- Trend power identification;
- ZigZag Pattern identification;
- Correlations identification;
- Bounce identification;
Trend identification
Trend identification is defining of trend direction, uptrend or downtrend. Trend direction is identified when 2 different moving averages is aligned at Trading timeframe and at Higher timeframe. By default these moving averages are 200SMA and 50EMA. Trend is defining bullish if 50EMA > 200SMA for trading timeframe (by default M15) and also for higher timeframe (by default H1).
Trend power identification
Trend Power Identification is an algorithms for identification strength of trend. For that purpose It operates with trend power points. Maximum 3 points for trading timeframe (by default M15) and 3 points for higher timeframe (by default H1). For trend power identifications fast moving averages and market current price are used. Be default moving averages are 6EMA, 18EMA.
If 18EMA > 50EMA for trading timeframe and for bullish trend then one trend power point is added,
If 6EMA > 18EMA for trading timeframe and for bullish trend then another one trend power point is added,
If Current Market Price > 6EMA for trading timeframe and for bullish trend then another one trend power point is added,
All the same algorithms are applying for higher timeframe. Thus we have 6 trend power point maximum. All this steps work with bearish trend also.
ZigZag Pattern Identification
It identifies patterns like higher high and higher low for bullish trend and Lower high and lower low for bearish trend.
Correlations Identification
Correlations is very important thing for bounce strategy. Than better currency correlation then much better winning odds of the trade. It seeks for correlated pairs with base and quote currencies. Pair is defined as correlated if trend direction is the same as current pair and trend power meets the specified criteria at indicator parameters. Trend direction and trend power is defined by moving averages alignment.
Bounce identification
Bounce identification is a market state when price is bouncing from one of specified moving average. Bounce identification processor contains many algorithms to identify good quality of moving average bouncing. Also these algorithms are constantly improved.
Indicator Parameters Description
General Config
Parameter Name | Type | Default Value | Description |
---|---|---|---|
Latency (Refresh delay in seconds) 0 means every tick | int | 1 | Latency (Refresh delay in seconds) 0 means every tick. Higher values reduce flickering. Lower values increase responsiveness. |
Log level | LogLevel | LogLevel::Error | Identify which log level will be printed. LogLevel ::Trace – Print Trace, Info, Warning, Error and Critical messages; LogLevel ::Info – Print Info, Warning, Error and Critical messages; LogLevel ::Warning – Print Warning, Error and Critical messages; LogLevel ::Error – Print Error and Critical messages; LogLevel ::Critical – Print Critical messages; |
Trend Identification Config
Parameter Name | Type | Default Value | Description |
---|---|---|---|
Trading time frame | ENUM_TIMEFRAMES | PERIOD_M15 | Period of trading timeframe. |
Higher time frame | ENUM_TIMEFRAMES | PERIOD_H1 | Period of higher timeframe. |
Period of fast moving average | int | 50 | Period of fast moving average for trend identification. |
Type of fast moving average | ENUM_MA_METHOD | MODE_EMA | Mode of fast moving average. ENUM_MA_METHOD::MODE_SMA – Simple averaging; ENUM_MA_METHOD::MODE_EMA – Exponential averaging; ENUM_MA_METHOD::MODE_SMMA – Smoothed averaging; ENUM_MA_METHOD::MODE_LWMA – Linear-weighted averaging; |
Price mode of fast moving average | ENUM_APPLIED_PRICE | PRICE_CLOSE | Price mode of fast moving average. PRICE_CLOSE – Close price; PRICE_OPEN – Open price; PRICE_HIGH – The maximum price for the period; PRICE_LOW – The minimum price for the period; PRICE_MEDIAN – Median price, (high + low)/2; PRICE_TYPICAL – Typical price, (high + low + close)/3; PRICE_WEIGHTED – Weighted close price, (high + low + close + close)/4; |
Period of slow moving average | int | 200 | Period of slow moving average for trend identification. |
Type of slow moving average | ENUM_MA_METHOD | MODE_SMA | Mode of slow moving average. ENUM_MA_METHOD::MODE_SMA – Simple averaging; ENUM_MA_METHOD::MODE_EMA – Exponential averaging; ENUM_MA_METHOD::MODE_SMMA – Smoothed averaging; ENUM_MA_METHOD::MODE_LWMA – Linear-weighted averaging; |
Price mode of slow moving average | ENUM_APPLIED_PRICE | PRICE_CLOSE | Price mode of slow moving average. PRICE_CLOSE – Close price; PRICE_OPEN – Open price; PRICE_HIGH – The maximum price for the period; PRICE_LOW – The minimum price for the period; PRICE_MEDIAN – Median price, (high + low)/2; PRICE_TYPICAL – Typical price, (high + low + close)/3; PRICE_WEIGHTED – Weighted close price, (high + low + close + close)/4; |
Use current price for trend identification | CurrentPriceType | CurrentPriceType::CANDLE_PRICE | Current price for trend identification (by default it’s Price > 50EMA > 200SMA for bullish and opposite for bearish). CurrentPriceType::BID_PRICE – Use BID price as current market price; CurrentPriceType::CANDLE_PRICE – Use candle high price as current market price for uptrend and candle low price as current market price for downtrend; CurrentPriceType::IGNORE_PRICE – ignore current market price and use formula fast MA ( 50EMA) > slow MA (200SMA) for bullish and opposite for bearish; |
Candle extension ratio (used if “Candle price” type is selected) | double | 0.0 | Candle price extension ratio. Used only if CurrentPriceType::CANDLE_PRICE is selected for “ Use current price for trend identification” property. Formula: Candle high = candle high + ((candle high – candle low) * Candle extension ratio); Candle low = candle low – ((candle high – candle low) * Candle extension ratio); |
Trend Power Identification Config
Parameter Name | Type | Default Value | Description |
---|---|---|---|
Period of fast trend power moving average | int | 6 | Period of fast moving average for trend power identification. |
Type of fast trend power moving average | ENUM_MA_METHOD | MODE_EMA | Mode of fast moving average for trend power identification. ENUM_MA_METHOD::MODE_SMA – Simple averaging; ENUM_MA_METHOD::MODE_EMA – Exponential averaging; ENUM_MA_METHOD::MODE_SMMA – Smoothed averaging; ENUM_MA_METHOD::MODE_LWMA – Linear-weighted averaging; |
Price of fast trend power moving average | ENUM_APPLIED_PRICE | PRICE_CLOSE | Price mode of fast moving average for trend power identification. PRICE_CLOSE – Close price; PRICE_OPEN – Open price; PRICE_HIGH – The maximum price for the period; PRICE_LOW – The minimum price for the period; PRICE_MEDIAN – Median price, (high + low)/2; PRICE_TYPICAL – Typical price, (high + low + close)/3; PRICE_WEIGHTED – Weighted close price, (high + low + close + close)/4; |
Period mode of slow trend power moving average | int | 18 | Period of slow moving average for trend power identification. |
Type of slow trend power moving average | ENUM_MA_METHOD | MODE_EMA | Mode of slow moving average for trend power identification. ENUM_MA_METHOD::MODE_SMA – Simple averaging; ENUM_MA_METHOD::MODE_EMA – Exponential averaging; ENUM_MA_METHOD::MODE_SMMA – Smoothed averaging; ENUM_MA_METHOD::MODE_LWMA – Linear-weighted averaging; |
Price mode of slow trend power moving average | ENUM_APPLIED_PRICE | PRICE_CLOSE | Price mode of slow moving average for trend power identification. PRICE_CLOSE – Close price; PRICE_OPEN – Open price; PRICE_HIGH – The maximum price for the period; PRICE_LOW – The minimum price for the period; PRICE_MEDIAN – Median price, (high + low)/2; PRICE_TYPICAL – Typical price, (high + low + close)/3; PRICE_WEIGHTED – Weighted close price, (high + low + close + close)/4; |
Use current price for trend power identification | CurrentPriceType | CANDLE_PRICE | Current price for trend power identification. CurrentPriceType::BID_PRICE – Use BID price as current market price; CurrentPriceType::CANDLE_PRICE – Use candle high price as current market price for uptrend and candle low price as current market price for downtrend; CurrentPriceType::IGNORE_PRICE – ignore current market price and use only MAs |
Candle extension ratio (used if “Candle price” type is selected) | double | 0.2 | Candle price extension ratio. Used only if CurrentPriceType::CANDLE_PRICE is selected for “Use current price for trend power identification” property. Formula: Candle high = candle high + ((candle high – candle low) * Candle extension ratio); Candle low = candle low – ((candle high – candle low) * Candle extension ratio); |
Correlation Identification Config
Parameter Name | Type | Default Value | Description |
---|---|---|---|
Trend power weight for trading timeframe (from 0 to 3) | int | 0 | Trend power weight of correlated pairs for trading timeframe (M15 by default). Trend power weight is algorithm for calculation of trend power. Minimum weight is 0. Maximum weight is 3. 0 – Do not calculate trend power. Maximum trend power for this algorithm is 0. 1 – Price > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 1 (each satisfied condition adds 1 trend power point). 2 – Price > Trend power slow MA (18EMA) > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 2 (each satisfied condition adds 1 trend power point). 3 – Price > Trend power fast MA (6EMA) > Trend power slow MA (18EMA) > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 3 (each satisfied condition adds 1 trend power point); Conditions are checked by priority from highest to lowest. If more higher priority condition is not satisfied then next condition will not be checked. For example if this property is set to 3 then First condition is: Trend power slow MA (18EMA) > Trend fast MA (50EMA). And if this condition is true then one point of trend power will be added and next condition will be checked. If this condition is false then a point of trend power will not be added and next condition will not be checked. Second condition is: Trend power slow MA (18EMA) > Trend fast MA (50EMA). It uses the same rules as for first condition. Third condition is: Price > Trend power fast MA (6EMA). It uses the same rules as for first condition. |
Min trend power for trading timeframe (from 0 to 3) | int | 0 | Min required trend power for trading timeframe to make rect of correlation indicator signaled. This property must not be higher than value from “Trend power weight for trading timeframe” property. |
Trend power weight for higher timeframe (from 0 to 3) | int | 1 | Trend power weight of correlated pairs for higher timeframe (H1 by default). Trend power weight is algorithm for calculation of trend power. Minimum weight is 0. Maximum weight is 3. 0 – Do not calculate trend power. Maximum trend power for this algorithm is 0. 1 – Price > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 1 (each satisfied condition adds 1 trend power point). 2 – Price > Trend power slow MA (18EMA) > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 2 (each satisfied condition adds 1 trend power point). 3 – Price > Trend power fast MA (6EMA) > Trend power slow MA (18EMA) > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 3 (each satisfied condition adds 1 trend power point); Conditions are checked by priority from highest to lowest. If more higher priority condition is not satisfied then next condition will not be checked. For example if this property is set to 3 then First condition is: Trend power slow MA (18EMA) > Trend fast MA (50EMA). And if this condition is true then one point of trend power will be added and next condition will be checked. If this condition is false then a point of trend power will not be added and next condition will not be checked. Second condition is: Trend power slow MA (18EMA) > Trend fast MA (50EMA). It uses the same rules as for first condition. Third condition is: Price > Trend power fast MA (6EMA). It uses the same rules as for first condition. |
Min trend power for higher timeframe (from 0 to 3) | int | 1 | Min required trend power for higher timeframe to make rect of correlation indicator signaled. This property must not be higher than value from “Trend power weight for higher timeframe” property. |
Correlation type | CorrelationType | CorrelationType::BOTH | Type of correlation pair. CorrelationType::BASE – Searching correlations only with base currency; CorrelationType::QUOTE – Searching correlations only with quote currency; CorrelationType::BOTH – Searching correlations with base and quote currency; |
Correlation source type | CorrelationSourceType | CorrelationSourceType::MARKETWATCH | Source of pairs from which correlation will be calculated. CorrelationSourceType::MARKETWATCH – All pairs from market watch list; CorrelationSourceType::ALL – All available pairs from current broker; |
Use current price for trend power identification | CurrentPriceType | CurrentPriceType::CANDLE_PRICE | Current price for trend power identification of correlated pairs. CurrentPriceType::BID_PRICE – Use BID price as current market price; CurrentPriceType::CANDLE_PRICE – Use candle high price as current market price for uptrend and candle low price as current market price for downtrend; CurrentPriceType::IGNORE_PRICE – ignore current market price and use only MAs |
Candle extension ratio (used if “Candle price” type is selected) | double | 0.2 | Candle price extension ratio. Used only if CurrentPriceType::CANDLE_PRICE is selected for “ Use current price for trend power identification” property. Formula: Candle high = candle high + ((candle high – candle low) * Candle extension ratio); Candle low = candle low – ((candle high – candle low) * Candle extension ratio); |
ZigZag Pattern Config
Parameter Name | Type | Default Value | Description |
---|---|---|---|
Depth of ZigZag pattern | int | 6 | Depth is the minimum number of bars with no second maximum or minimum deviation from the bar. |
Deviation of ZigZag pattern | int | 5 | Deviation is the number of pips or points (depending on the market) after the previous minimum or maximum is formed. |
Backstep of ZigZag pattern | int | 3 | Backstep reflects the minimum amount of bars between which the high and low can be plotted. |
Is start at depth of swing | bool | true | If true ZigZag pattern is checked at depth of swing (when appears low point for bullish or high point of bearish). Otherwise ZigZag pattern is checked as new point is appeared It can be low or high point. This picture demonstrates how it works. ZigZag pattern will be valid only if this property is set to “true” value. ![]() |
Moving Average Bounce Config
Parameter Name | Type | Default Value | Description |
---|---|---|---|
Moving Average bounce expression | string | 18:1:0;50:1:0 | Expression for moving averages description. This expression describes from which moving averages bounce should be. Their periods, methods and applied prices. Expression has such format [Period]:[Method]:[AppliedPrice]. [Period] – it’s a period of a moving average. [Method] – it’s a method of a moving average. It can be one of [0 – SMA (Simple averaging), 1 – EMA (Exponential averaging), 2 – SMMA (Smoothed averaging), 3 – LWMA (Linear-weighted averaging)]. [AppliedPrice] – it’s a price which will be applied to moving average. It can be one of [0 – CLOSE, 1 – OPEN, 2 – HIGH, 3 – LOW, 4 – MEDIAN, 5 – TYPICAL, 6 – WEIGHTED]. Expression can be repeated to search a bounce from several moving averages. Each expression should be separated with “;” sign. For example expression to describe 2 moving averages should look like this: [Period]:[Method]:[AppliedPrice]; [Period]:[Method]:[AppliedPrice]. |
Distance from Moving Average, 0 – means exact bounce | int | 0 | It’s a maximum distance in points (the smallest price movement) between moving average and candle close price. If distance between moving average and candle close price less or equal to this value then algorithm considers that there is a MA bounce. If value is set to 0 then algorithm considers MA bounce exactly at bouncing time.
Recommended value is 0. At this case it’s executed many algorithms to improve quality of signal. For example ignoring candle with opposite direction from trend. Ignoring candle if they close below of bouncing moving average for bullish trend and opposite for bearish trend. And many other algorithms. |
Notifications Config
Parameter Name | Type | Default Value | Description |
---|---|---|---|
Notifications process interval in sec | int | 10 | Interval for processing of notifications conditions (higher value reduce CPU usage). |
MA Bounce Notification Config
Parameter Name | Type | Default Value | Description |
---|---|---|---|
Enable MA bounce alerts | bool | true | Send notification via MetaTrader Alert system. |
Enable MA bounce email notification | bool | false | Send notification via Email. |
Enable MA bounce push notification | bool | false | Send notification via mobile Push. |
Notification’s execution | NotificationExecution | NotifyAsSoonAsPossible | Notification’s execution type. NotificationExecution::NotifyAsSoonAsPossible – instantly send notification as all conditions are met; NotificationExecution::NotifyOnceCandleClose – send notification as N-Period candle is closed if all conditions are met; |
Candle period for Notification’s execution | ENUM_TIMEFRAMES | PERIOD_CURRENT | Candle period for sending notification if NotificationExecution::NotifyOnceCandleClose is selected for “ Notification’s execution” property. |
Min delay for the same notification (sec) | int | 5400 | Delay time between sending the same notification if all conditions will be met several times. |
Signal Code | string | [MA Bounce] | Prefix before message of MA Bounce notification. |
Use short message form of notification | bool | false | If true then uses short form of message for MA Bounce notification, otherwise uses full form of message. |
Show notifications arrows on chart | bool | true | If true then shows arrow on a chart when MA Bounce notification is thrown. |
Trend power weight for trading timeframe (from 0 to 3) | int | 2 | Trend power weight for trading timeframe (M15 by default). Trend power weight is algorithm for calculation of trend power. Minimum weight is 0. Maximum weight is 3. 0 – Do not calculate trend power. Maximum trend power for this algorithm is 0. 1 – Price > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 1 (each satisfied condition adds 1 trend power point). 2 – Price > Trend power slow MA (18EMA) > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 2 (each satisfied condition adds 1 trend power point). 3 – Price > Trend power fast MA (6EMA) > Trend power slow MA (18EMA) > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 3 (each satisfied condition adds 1 trend power point); Conditions are checked by priority from highest to lowest. If more higher priority condition is not satisfied then next condition will not be checked. For example if this property is set to 3 then First condition is: Trend power slow MA (18EMA) > Trend fast MA (50EMA). And if this condition is true then one point of trend power will be added and next condition will be checked. If this condition is false then a point of trend power will not be added and next condition will not be checked. Second condition is: Trend power slow MA (18EMA) > Trend fast MA (50EMA). It uses the same rules as for first condition. Third condition is: Price > Trend power fast MA (6EMA). It uses the same rules as for first condition. |
Min trend power for trading timeframe (from 0 to 3) | int | 2 | Minimum required trend power for trading timeframe. It’s a condition which have to be satisfied for notification sending. This property value must not be higher than value from “Trend power weight for trading timeframe (from 0 to 3)” property. |
Trend power weight for higher timeframe (from 0 to 3) | int | 2 | Trend power weight for higher timeframe (H1 by default). Trend power weight is algorithm for calculation of trend power. Minimum weight is 0. Maximum weight is 3. 0 – Do not calculate trend power. Maximum trend power for this algorithm is 0. 1 – Price > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 1 (each satisfied condition adds 1 trend power point). 2 – Price > Trend power slow MA (18EMA) > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 2 (each satisfied condition adds 1 trend power point). 3 – Price > Trend power fast MA (6EMA) > Trend power slow MA (18EMA) > Trend fast MA (50EMA) for bullish and opposite for bearish (if “Use current price for trend power identification” property is CurrentPriceType::IGNORE_PRICE then Price condition is ignoring). Maximum trend power for this algorithm is 3 (each satisfied condition adds 1 trend power point); Conditions are checked by priority from highest to lowest. If more higher priority condition is not satisfied then next condition will not be checked. For example if this property is set to 3 then First condition is: Trend power slow MA (18EMA) > Trend fast MA (50EMA). And if this condition is true then one point of trend power will be added and next condition will be checked. If this condition is false then a point of trend power will not be added and next condition will not be checked. Second condition is: Trend power slow MA (18EMA) > Trend fast MA (50EMA). It uses the same rules as for first condition. Third condition is: Price > Trend power fast MA (6EMA). It uses the same rules as for first condition. |
Min trend power for higher timeframe (from 0 to 3) | int | 2 | Minimum required trend power for higher timeframe. It’s a condition which have to be satisfied for notification sending. This property value must not be higher than value from “Trend power weight for higher timeframe (from 0 to 3)” property. |
Min correlations with base currency | int | 1 | Minimum required correlations with base currency. It’s a condition which have to be satisfied for notification sending. |
Min correlations with quote currency | int | 1 | Minimum required correlations with quote currency. It’s a condition which have to be satisfied for notification sending. |
Min total correlations | int | 3 | Minimum required total correlations. It’s a condition which have to be satisfied for notification sending. |
Min correlation scores | int | 20 | Minimum required correlation scores. It’s a condition which have to be satisfied for notification sending. |
ZigZag pattern | bool | true | Should been ZigZag pattern. It’s a condition which have to be satisfied for notification sending. |
Require Moving Average bounce | bool | true | Should been bounce from moving average. It’s a condition which have to be satisfied for notification sending. |
Chart examples