EA "Pattern 123 Zig Zag".

EA "Pattern 123 Zig Zag".

14 January 2019, 10:05
Oleg Popov
0
913

Pattern 123 Zig Zag

Version 11.0 2021.01.24
New variable "StartCondition"
If
"StartCondition==Pattern 123 ZigZag"
// ...start conditions is a breakdown of the 123 ZigZag pattern level, the algorithm that was originally created.

User Suggestion:
(1) The number of orders is small. The ordering interval is 1 to 4 days or more. Taking advantage of ZigZag, I would like to place an order / close at level 3 (maximum wavelength).
If
"StartCondition==Extremum Zig Zag"
// ...the start conditions are a breakdown of the near extremum level, a new algorithm.

User Suggestion:
(2) Currently, BUY is being held in the mountains and SELL is being held in the valley. I wonder if this can be reversed. (SELL in the mountains, BUY in the valley)
New variable "ReversInputSignal"
// ReversInputSignal=true/false
// the reverse ONLY works for market execution ("Type of execution_ Instant/Market Execution")
Version 10.0 2020.07.29
User suggestion:
If you could add two options for the SL and TP- Real and Virtual, that would be nice. People with VPS could use the virtual option.

Added new variables:
// "VirtualSL"=false\true;
// "VirtualTP"=false\true;
Required condition for performing these functions:
// "The type of Grid" == "no Grid";
// "Stop’n’Reverse orders" == false;

User suggestion:
Does the EA have the option of adjusting entry by user defined pips? For example, if the predetermined long entry is 1.65432 based on zig zag indicator,, then the user should be able to add 10 or 15 pips to it to make 1.65532 or 1.65582 the new entry point. This would help prevent entering false breakouts.

Added new variables:
// "BUY_AdjustingEntry +/- point";
// "SELL_AdjustingEntry +/- point".
Version 9.0 2020.07.05
At the user's suggestion, it is now possible to place reverse pending stop orders at the stop loss levels of open positions.
New variables are used for this purpose:
"Stop’n’Reverse orders" - true\false;
"Multiplier Stop’n’Reverse orders" - multiplier for a reverse pending stop order, any positive number(example: 0.57, 1.05, 15.0, etc.);
"MaxLot Stop’n’Reverse orders" - the maximum allowed lot size for a reverse pending stop order.

New update to version 8.0 from 08.06.2020.
At the user's suggestion, it is now possible to select the maximum number of orders allowed for trading.

New variables are used for this purpose:
"BUY...maximum allowed number of orders"
"SELL..maximum allowed number of orders"

Robot Advisor automatically trades on Pattern 123 of the ZigZag indicator. The expert provides a mode of restoring balance after a loss.

Opportunities

  • Visually draws in real time on the current chart:
    • Pattern 123, built on specified input parameters;
    • the level of the expected breakdown;
    • level of estimated take profit;
    • signal line to the input.
  • You can use a fixed transaction amount.
  • The volume of each transaction can be calculated automatically, depending on the variable "Risk Equity (%)" set in the input parameters.
  • The choice of the type of trade or work only as an indicator.
  • Choice of execution type:
    • immediate;
    • pending stop orders.
  • Select the type of use of the loss level (stop loss):
    • items;
    • price point #3 pattern 123;
  • Select the type of use of profit level (take profit):
    • items;
    • calculation relative to Pattern 123.
  • You can set the parameters for the Pattern 123 search:
    • time period and variable Depth of ZigZag indicator, on which Pattern search will be performed;
    • allowable shoulder level [2, 3], the size of the shoulder [1,2].
  • Trading in a given period of time.
  • Closing positions and orders on time every day.
  • You can use the grid trading strategy.
  • There is a trailing of positions on the High\Low level of the previous candle or on the parabolic SAR indicator.
  • There is a trailing and closing positions in terms of money.
  • The mode of restoring balance in cases of loss.

Input parameters

= = = = = = ZigZag Pattern setup = = = = = Settings for the pattern ======

  • ZigZag Time Frames - the time period of the ZigZag indicator, on which the pattern will be searched. Periods used:
    • M1
    • M5
    • M15
    • M30
    • H1
    • H4
    • D1
  • ZigZag Depth - variable ZigZag indicator Depth, value from 5 to 50.
  • Minimum level 2-3, size 1-2 - the minimum allowable shoulder level [2, 3], the size of the shoulder [1,2]. The number is from 0.001 to 0.999.
  • Maximum level 2-3, size 1-2 - the maximum allowable shoulder level [2, 3], depending on the size of the shoulder [1,2]. The number is from 0.001 to 0.999.
  • filter1 - additional filter
    • true - used;
    • false - NOT used.

====== Time of order start / stop ====== Start and end time of order placement ======

  • startHOUR - start time
  • startMINUTE - start time
  • stopHOUR - end time
  • stopMINUTE - end time

====== Orders are closed on time every day ====== Closing orders by time every day ======

  • OrderClosingTime - function to close orders by time
    • true - used;
    • false - NOT used.
  • closeHOUR - closing time;
  • closeMINUTE - closing time.

====== Trading setup ====== ====== Trade Preferences

  • The magic number - the adviser's identification number can be -1 (minus one), 0, or any positive number.
    • If "The magic number" is zero, then the adviser will consider all open or set orders manually as its own.
    • If "The magic number" is -1 (minus one), the adviser will consider all open or set orders manually or by another adviser as its own.
  • Allowed to open orders - you need to select the type of trading from the options:
    • No permission to open orders - placing orders is not allowed. Can be used as an indicator;
    • Only Buy - a purchase order is allowed only for purchase;
    • Only Sell - setting a sell order is allowed;
    • Buy & Sell - placing orders for both buying and selling is allowed.
  • Type of execution - choose the type of execution from the options:
    • Instant / Market Execution - immediate;
    • Pending Order Stop - pending stop orders.
  • Fixed lot (volume) - the volume of the start order to be set.
    • If "Fixed lot (volume)" is zero, then the calculation of the volume of the order to be set will be calculated automatically, depending on the variable "Risk Equity (%)" set in the input parameters.
    • When "Fixed lot (volume)" is greater than zero, the parameter "Risk Equity (%)" becomes inactive. And the volume of installed orders will be fixed.
  • Maximum start lot - the maximum amount of the start order to be set.
  • Risk Equity (%) - the permissible risk per transaction as a percentage of the available funds in the account. As risk increases, profits increase, but drawdown also increases.
  • do not place new orders after closing - permission to place new orders, taking into account the history and type of closed positions for the current temporary session:
    • true - if the current temporary session was to close a BUY position, then placing new BUY orders is prohibited. And if for the current temporary session there was a closing of the SELL position, then placing new SELL orders is prohibited.
    • false - when placing new orders, the history of closing orders for the current temporary session is NOT taken into account.
  • "BUY...maximum allowed number of orders" - the maximum allowed number of purchase orders. Open BUY positions and pending BUY_STOP orders are taken into account together.
  • "SELL..maximum allowed number of orders" - the maximum allowed number of sell orders. Open SELL positions and pending SELL_STOP orders are taken into account together.
    ====== StopLoss ======
    • StopLoss Type - type of use loss level (stop loss):
      • No Stop Loss - no stop loss;
      • Number - use the value "StopLoss Number"
        • StopLoss Number - level in points;
      • Point # 3 - the price of the point #3 of the pattern 123. It is possible to adjust the stop loss level separately for each type of trade. The adjustment can also be added to the stop loss level, and can be subtracted from the stop loss level.
        • BUY_StopLoss Point #3 correction +/- 
        • SELL_StopLoss Point #3 correction +/- 
    ====== TakeProfit ======
    • TakeProfit Type - take profit type
      • No TakeProfit - no take profit;
      • Number - the value is "TakeProfit Number"
        • TakeProfit Number - the level in points;
      • Calculated level - calculated value = point 3 (price) +/- (distance between points 1 and 2 * "Level to calculate TakeProfit")
        • Level to calculate TakeProfit - a number from 0.001 (it is possible to use Fibonacci levels: 1.000, 1.236, 1.382, 1.618, 1.764, 2.000, etc.)

    ======     Trailing Stop.     ======

    • TypeTrailingStop - trailing stop type:
      • No TrailingStop - the trailing stop is disabled;
      • Parabolic SAR - the Parabolic SAR value is used;
      • By candle High/Low - the levels of the previous candle are used.
      • Point #3 - (disabled in current version) .
    • Only profit - true\false enable trailing only after entering profit plus (in points):
      • true - trailing stop is enabled only when positive profit (in points) of the order;
      • false - trailing stop does not take into account the profit of the order.
    • LevelTrailingStop (point) - trailing stop level from the current price (in points).
    • Time Frames TrailingStop - it is necessary to choose from the proposed time period for trailing stop M1, M5, M15, M30, H1, H4, D1.

    ====== Grid setup ====== Grid settings ======

    • startGridHOUR - the start time for placing grid orders;
    • startGridMINUTE - the start time for placing grid orders;
    • stopGridHOUR - the end time for placing grid orders;
    • stopGridMINUTE - the end time for placing grid orders;
    • The type of Grid - type of grid strategy usage:
      • no Grid - the grid is not used;
      • fixed distance - grid orders are placed at a fixed distance from the loss-making one;
      • strategy # 1 - the grid is set by the algorithm.
      • FIBO level 2-3 - grid orders are placed at Fibo levels calculated relative to the 2-3 leverage. You can specify up to five levels in the parameters.  The values of the levels should go in ascending order starting from the first level (1st level  < 2nd level  < 3rd level  < 4th level  < 5th level ). If you want to use only three levels, you should set the fourth and fifth levels to zero (  4th level 2-3 = 0  и 5 th level 2-3 = 0). If you want to use only one level, you should set the second, third, fourth, and fifth levels to zero ( 2nd level 2-3=0 и  3rd level 2-3=0 и  4th level 2-3 = 0  и 5 th level 2-3 = 0). If 1st level=0, grid orders will NOT be placed at Fibo levels .
        •  1st level 2-3
        • 2nd level 2-3
        • 3rd level 2-3
        • 4th level 2-3
        • 5th level 2-3
          Also, when trading by levels, all orders have a stop loss level equal to the stop loss level of the starting order.
    • The method of lot calculation - method of calculating the volume of the averaging order
      • multiply by MartinGrid - the previous volume is multiplied by the MartinGrid value;
      • zoom in on MartinGrid - the MartinGrid value is added to the previous volume.
    • Distance between orders Grid - the minimum distance of the grid.
    • TakeProfitGrid - profit level when using the grid.
    • Maximum Grid lot - the maximum volume of the grid order to be set.
    • MartinGrid - is a positive number.
    • TF strategy # 1 - time period for algorithm strategy # 1 . Periods used: M1, M5, M15, M30, H1, H4, D1.

    ====== Trailing money.Closing profit. ====== Trailing and closing positions by level in money. ======

    • Closing profit - escort and closing by profit:
      • No - not used;
      • Joint buy and sell - together are followed by BUY and SELL, closing by total gross profit (BUY profit + SELL profit).
      • Individual to buy or sell - separately accompanied by BUY or SELL, closing depending on their profit.
    • Trailing money with - the amount of money at which profit starts.
    • Step Trailing the money - profit tracking step in the deposit currency.

    ====== Balance recovery mode ====== ====== Balance Recovery Mode

    • Balance recovery mode - balance recovery mode . The advisor performs auto calculation of the volume of the starting transaction on the next day in case of loss:
      • true - the mode is used;
      • false - the mode is NOT used.
    • Efforts to recover loss - efforts to recover losses.

    ====== Display ======

    • 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.

    If you have any questions or have ideas on how to improve this advisor, feel free to contact us .

    The settings for the Strategy Tester are here.













    Share it with friends: