Pattern 123 Zig Zag
- Visually draws in real time on the current chart:
- Pattern 123, built on given input parameters;
- level of expected breakdown;
- level of estimated take profit;
- input signal line.
- You can use a fixed transaction volume.
- 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:
- pending stop orders.
- The choice of the type of use of the level of loss (stop loss):
- the price of point number 3 Pattern 123.
- The choice of the type of profit level use (take profit):
- calculation for Pattern 123.
- You can set the parameters for the Pattern 123 search:
- time period and variable Depth of the ZigZag indicator on which Pattern 123 will be searched;
- allowable shoulder level [2, 3], on the size of the shoulder [1,2].
- Trading in a given period of time.
- Closing positions and orders by time every day.
- You can use a 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 trailing and closing positions in terms of money.
- Balance recovery mode in case of loss.
- The magic number - the EA’s identification number can be -1 (minus one), 0, or any positive number.
- If "The magic number" is equal to zero, then the EA will consider all open or placed orders manually as its own.
- If "The magic number" is -1 (minus one), then all open or set orders manually or by another adviser, the adviser will consider them to be his own.
- Allowed to open orders - type of trade from the proposed options:
- No permission to open orders - placing orders is not allowed. It can be used as an indicator;
- Only Buy - only a buy order is allowed;
- Only Sell - only a sell order is allowed;
- Buy & Sell - placing orders for both buy and sell is allowed.
- Type of execution - select the type of execution from the proposed options:
- Instant / Market Execution - immediate;
- Pending Order Stop - pending stop orders.
- Fixed lot (volume) - volume of the placed order.
- If "Fixed lot (volume)" is equal to zero, then the calculation of the volume of the placed order 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 placed orders will be fixed.
- Risk Equity (%) - the allowable risk per transaction as a percentage of the available funds in the account. With increasing risk, profit increases, but also drawdown also increases.
- StopLoss Type - type of use of the loss level (stop loss):
- No Stop Loss - no stop loss;
- Number - uses the value "StopLoss Number"
- StopLoss Number - level in points;
- Point # 3 - the price of point number 3 of pattern 123;
- Point # 1 - the price of point number 1 of pattern 123.
- TakeProfit Type - type of use of profit level (take profit)
- No TakeProfit - no take profit;
- Number - the value "TakeProfit Number" is used
- TakeProfit Number - 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.)
- ZigZag Time Frames - time period of the ZigZag indicator, on which the pattern will be searched.
- ZigZag Depth - Variable Depth of the ZigZag indicator, a value from 5 to 50.
- Minimum level 2-3, size 1-2 - the minimum acceptable level of the shoulder [2, 3], from the size of the shoulder [1,2]. A number from 0.001 to 0.999.
- Maximum level 2-3, size 1-2 - the maximum allowable shoulder level [2, 3], from the size of the shoulder [1,2]. A number from 0.001 to 0.999.
Have questions or have ideas for improving this advisor, do not hesitate to contact .
A more detailed description is here .
The results and settings of the strategy tester are here .
The take profit level is set at the same distance from the opening price as the stop loss.
If the stop loss is 100 points, then the take profit will also be 100 points. In other words, the take profit will repeat the size of the stop loss.
"StartCondition==Pattern 123 ZigZag"
// ...start conditions is a breakdown of the 123 ZigZag pattern level, the algorithm that was originally created.
(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).
"StartCondition==Extremum Zig Zag"
// ...the start conditions are a breakdown of the near extremum level, a new algorithm.
(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"
// the reverse ONLY works for market execution ("Type of execution_ Instant/Market Execution")
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:
Required condition for performing these functions:
// "The type of Grid" == "no Grid";
// "Stop’n’Reverse orders" == false;
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".
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 variables are used for this purpose:
"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.
In the stop loss menu, in the "StopLoss Type" section, you can now select a stop from "point #1".
The error occurred only when using a grid based on Fibo levels .
Levels are created relative to the shoulder 2-3.
Levels can be changed by the user.
Added the ability to adjust the stop loss level
(if you are using Point #3 for stop-loss ).
The adjustment value can be added or subtracted.
The adjustment values are separate for BUY and separate for SELL.
Added trailing stop on Parabolic SAR indicator.
"Display information = true" - display information.
"Display information = false" - do not display information.