Zigzag Extremum points
- Experts
- Oleg Popov
- Versione: 8.0
- Aggiornato: 9 agosto 2023
New version 8.00 is available.
In this version, I tried to take into account the wishes of the user. Each of you can also take part in the improvement of this advisor.
In the default settings, the adviser opens trades when the extremum point is broken standard indicator Zigzag.
When the upper point of the zigzag extremum is broken, it opens a buy deal, and when the lower point of the zigzag extremum is broken, it opens a sell deal.
In addition to the standard ZigZag indicator, which is available in the terminal, it is possible to use Point Zig Zag indicator .
Variables.
- Spread (maximum allowed) - the maximum allowable spread for trading.
- MaxNumber Trades - the maximum allowable number of transactions.
- startHOUR, startMINUTE, stopHOUR, stopMINUTE - time to open "Start" orders.
- The magic number Advisor identification number.
- This is used to start - choose a strategy for the adviser from the proposed one:
5.1 (#5)i_ZigZag - standard indicator zigzag, available in the terminal. The EA opens trades when the extremum point is broken standard indicator Zigzag.
5.2 (#6) i_PointZigZag - author's custom indicator. Requires terminal installation. To test the adviser, it is enough to install the demo version of the indicator. The description of the strategy can be found in the description of the "Point ZigZag" indicator ( post#5 ).
5.3 (#7) i_PointZigZag - author's custom indicator. Requires terminal installation. To test the adviser, it is enough to install the demo version of the indicator. The description of the strategy can be found in the description of the "Point ZigZag" indicator ( post#6 ). An important condition for this strategy to work is setting HighPoints (for Start ) should be more customization Points (for start ) .
5.4 (#70)_Canal - start trading on the breakdown of the reversal levels of the "Point Zig Zag" indicator (it requires installation in the terminal ). If the market reverses and the price breaks through the opposite reversal level of the Point Zig Zag indicator, a Channel is created. The description of the strategy can be found in the description of the indicator " Point ZigZag" (post#).
5.5 (#77)_Canal - start of trading, when EA is turned on, two orders are opened (buy and sell), subsequently a Channel is created according to the reversal levels of the "Point Zig Zag" indicator ( t requires installation in the terminal ) .Attention! After installing the indicator i_PointZigZag check the installation location: MQL4 > Indicators > Market > Point Zig Zag.ex4 (see screenshot).
- Trend filter MA (for Start) - ( false\true) filter by MA indicator. If "Trend filter MA (for Start) = TRUE", and MA above the price, the EA only sells. If the MA is below the price, the EA only buys. This trend filter is not used if the input variable "This is used to start = (#77)_Canal" is enabled in the EA.
6.1 MA_timeframe (for Trend filter MA) - settings for the MA indicator (timeframe )
6.2 MA_period (for Trend filter MA) - settings for the MA indicator (period)
6.3 MA_method (for Trend filter MA) - settings for the MA indicator (method). - Filter 4_lines_MA (for Start) - filter by four lines of the MA indicator, the filter works only if the "Point Zig Zag" indicator is present. This trend filter is not used if the input variable "This is used to start = (#77)_Canal" is enabled in the EA.
_No - the filter is not used;
_Trend - trend trading,
conditions for buying MA1 > MA2 > MA3 > MA4;
conditions for selling MA1 < MA2 < MA3 < MA4;
_Anti-Trend - trading against the trend (trading on a rollback, or from overbought / oversold zones),
buy conditions MA1 < MA2 < MA3 < MA4;
selling conditions MA1 > MA2 > MA3 > MA4 ;
7.1 MA1_timeframe (for "Filter 4_lines_MA") - settings for the MA1 indicator (timeframe)
7.2 MA1_period (for "Filter 4_lines_MA") - settings for the MA1 indicator (period)
7.3 MA1_method (for "Filter 4_lines_MA") - settings for the MA1 indicator (method).
7.4 MA2_timeframe (for "Filter 4_lines_MA") - settings for the MA2 indicator (timeframe)
7.5 MA2_period (for "Filter 4_lines_MA") - settings for the MA2 indicator (period)
7.6 MA2_method (for "Filter 4_lines_MA") - settings for the MA2 indicator (method).
7.7 MA3_timeframe (for "Filter 4_lines_MA") - settings for the MA3 indicator (timeframe)
7.8 MA3_period (for "Filter 4_lines_MA") - settings for the MA3 indicator (period)
7.9 MA3_method (for "Filter 4_lines_MA") - settings for the MA3 indicator (method).
7.10 MA4_timeframe (for "Filter 4_lines_MA") - settings for the MA4 indicator (timeframe)
7.11 MA4_period (for "Filter 4_lines_MA") - settings for the MA4 indicator (period)
7.12 MA4_method (for "Filter 4_lines_MA") - settings for the MA4 indicator (method). - All_Signals -
If "All_Signals = false" then entry into the market is allowed only if there is no open deal.
For example, if there is an open buy trade in the market, then a new buy trade will not be opened even if there is a signal to open a buy trade.
If "All_Signals = true" then entry to the market is allowed even if there are open deals.
For example, if the market has an open buy deal, then a new buy deal will be opened with each new signal to open a buy deal. - Depth (for i_ZigZag) - standard indicator setting zigzag. Used only in strategy (#5)i_ZigZag .
- Deviation (for i_ZigZag) - standard indicator setting zigzag. Used only in strategy (#5)i_ZigZag .
- Backstep (for i_ZigZag) - standard indicator setting zigzag. Used only in strategy (#5)i_ZigZag .
- HighPoints (for Start) - senior indicator setting Point Zig Zag. If you plan to use this setting, then it must be greater than the "Points (for Start)" variable. If you do not plan to use this setting, then it should be equal to the "Points (for Start)" variable. The minimum size in points between the two closest ZigZag extremum.
- Points (for start ) - indicator setting Point Zig Zag. The minimum size in points between the two closest ZigZag extremum.
- Fixed lot - the size of the traded volume.
- Lot as a % of the Balance(0.0=OFF) - auto calculation of the lot size (for the initial/starting order) as a percentage of the account balance.
If you are going to use automatic lot calculation, then you need to set the desired value (as a percentage).
If you are going to use a fixed lot size (for the initial / starting order), then you need to set
input variable "Lot as a % of the Balance(0.0=OFF)=0.0". - StopLoss (point) - loss ratio for each trade in points .
- TrailingStop_S -
_ False - not used;
_Simple - simple trailing stop with settings ( Start Trailing , step trailing );
_ISAR - trailing stop on the Parabolic SAR indicator with settings ( iSAR_timeframe , iSAR_step , iSAR_maximum ). - Start Trailing (for TrailingStop_Simple) - number of points (point) to start trailing stop (for TrailingStop_Simple) .
- Step Trailing (for TrailingStop_Simple) - step in trailing stop points (for TrailingStop_Simple) .
- iSAR_timeframe(for TrailingStop_iSAR) - parabolic SAR indicator setting (for TrailingStop_iSAR)
- iSAR_step(for TrailingStop_iSAR) - indicator setting Parabolic SAR (for TrailingStop_iSAR)
- iSAR_maximum(for TrailingStop_iSAR) - parabolic SAR indicator setting (for TrailingStop_iSAR)
- TypeTakeProfit- select the type [tp] for the adviser from the proposed one:
2 2.1 standard - [tp] is set for each transaction at a distance equal to the value of the variable Take Profit (point) .
22.2 total take profit - sum of all [tp] (one type of trade) is equal to variable value Take Profit (point) .
22.3 break-even level +/- TakeProfit - to the breakeven level of open trades (one type of trade) added variable value Take Profit (point) . - TakeProfit (point) - profit level in points.
- Closing profit - closing a deal after reaching a certain profit margin
24.1 no - not used;
24.2 joint buy and sell - joint calculation of BUY and SELL profits, closing on the total total profit (BUY profit + SELL profit).
24.3 Individual to buy or sell - separate calculation of profit for BUY and SELL, closing depending on your profit. - Profit target(money) - profit target in money for " Closing profit ".
- Target per day - True/False,
If True, the EA will trade until it reaches the target (value) set in the "Profit target per day(money)" variable ". When reaching the target, EA will close all open trades and will not open new trades until the next day.
If False, then the EA does not use this feature. - Profit target per day(money) - profit target per day.
- UseCanal - false\true
- Daily 200 SMA(trend filter for Canal) -
- Continuation of the channel-
30.1 along the initial price boundaries - continuation of the channel along the initial price boundaries;
30.2 on the signal from the indicator - continuation of the channel on a signal from the indicator. - Points (for Canal) - indicator setting Point Zig Zag for the Channel.
- Ratio_B_C - the ratio of the breakeven level and the size of the Channel. The minimum value is 0.01.
- TakeProfit target(for Canal) - profit target in points, if the "(#70)_Canal" or "(#77)_Canal" strategy is used.
- Allowed number of Canal positions (for Canal) - allowable number of positions Channel.
- Display RIGHT_UPPER information -
information about the settings in the upper right corner of the screen:
- true - display;
- false - DO NOT display.
- Display RIGHT_LOWER information -
additional information in the lower right corner of the screen:
- true - display;
- false - DO NOT display.
- openpriceonly -
used to speed up the test, only in the tester with the "only open prices" test model :
- true - used;
- false - NOT used.
If you like this Expert Advisor, then you can support the author with a kind review or purchase of the " i_PointZigZag " indicator.
Don't miss anything interesting, add me as a friend.
Hello Oleg, Could you arrange for him to close the real operation with the next opposite? thank you