Building a ZigZig_EA MT5

MQL5 Experts

Specification

Building a ZigZig_EA MT5
If you used ZigZag indicator at least once, you know how many compromises you have to make when searching for optimal parameters. Too small parameter values divide a big movement into small parts, while too big parameter values skip short movements. The algorithm for searching graphical patterns is very demanding as of quality of finding extremums. While trying to find a middle ground, I decided to use the indicator with small parameter values and create an additional superstructure combining unidirectional movements with short corrections into one movement.
The attached CTrends class Trend.mqh has been developed to solve this issue.  During the initialization, a reference to the indicator class object and the minimum movement value considered as a trend continuation are passed to the class.
To get data on extremums, the following methods are provided in the class Trend.mqh:
•    ExtremumByTime — get the extremum number in the database for a specified time,
•    Extremum — return extremum at a specified position in the database,
•    IsHigh — return true if a specified extremum is a top and false if it is a bottom.
The general information block features methods returning the total number of saved extremums, used symbol and timeframe.
------------------------------------------------------------------------------------------------------------------
The main class logic of Trend.mqh is implemented in the Calculate method. Let's take a closer look at it.
At the beginning of the method, check the relevance of the reference to the indicator class object and the presence of extremums found by the indicator.
Next, define the number of unprocessed extremums. If all extremums are processed, exit the method with the true result.
After that, request the necessary amount of extremums from the indicator class.
If there have been no extremums in the database up to this time, add the oldest extremum to the database by calling the AddTrendPoint method.
Next, arrange the loop with iteration over all downloaded extremums. Previous extremums before the last saved one are skipped.
In the next step, check if the extreme points are unidirectional. If a new extremum re-draws the previous one, update the data.
For oppositely directed extreme points, check whether the new movement is a continuation of a previous trend. If yes, update data on extremums. If no, add data on the extremum by calling the AddTrendPoint method;
------------------------------------------------------------------------------------------------------------------


You need the classes:
Include/ZigZag.mqh
Include/Trends.mqh

You might need those classes also:
Include/Pattern.mqh
Include/Header.mqh
Include/Trade/LimitTakeProfit.mqh

All functions from ZigZag indicator and the optimizer ZigZag.mqh and Trends.mqh should be changeable in the EA.
Based on the smoothed ZigZag signals, the EA should sell or buy as follows:
Here is an example of the logic needed. It would be good to encapsulate this logic in a separate class, so that it can easily fit on a new base later:
Let's say (optimized) ZigZag indicator generates a sell signal for EURUSD at 1.20660 then EA checks the latest bottom price where (optimized) ZigZag indicator turned upwards. This may was 1.20563. Then ZigZag_EA calculates the difference between 1.20660 and 1.20563 that is 0.00097 and divide it by a figure I want to choose, 6 for example That comes to 0.00016. Take profit is then 1,20643.
After that EURUSD make an unexpected rise to 1.2077 and (optimized) ZigZag indicator redraws and generates a sell signal again. ZigZag_EA sells again (a number of times of the first lot I want to set, like martingale. New take profit for the new sell position would be at (1.2077- 1.20563)/6+1.20563=1.205975 but ZigZag_EA must not set a new TP .
Meanwhile I am 0.00207 in loss with the first position, of course. Then market turns and the last position generates profit. At the very point when the profit of first position plus the profit of second position equals the first TP distance of 0.00097 close all sell positions.
For buy positions vice versa.

Files:

ZIP
MQL5.zip
13.0 Kb

Responded

1
Developer 1
Rating
(171)
Projects
194
11%
Arbitration
37
38% / 35%
Overdue
5
3%
Loaded
2
Developer 2
Rating
(12)
Projects
12
25%
Arbitration
1
0% / 100%
Overdue
0
Free
3
Developer 3
Rating
(155)
Projects
239
70%
Arbitration
3
67% / 33%
Overdue
20
8%
Free
4
Developer 4
Rating
(379)
Projects
407
70%
Arbitration
3
100% / 0%
Overdue
2
0%
Loaded
5
Developer 5
Rating
(42)
Projects
88
14%
Arbitration
30
30% / 57%
Overdue
36
41%
Working
Similar orders
The EA should have the input of both indicators for i will be putting my own settings Buy/sell order conditions to be met before an order is executed 1. BUY ORDERS; a weak/strong low signal appears (from smart money concept indicator) and must be touching/sitting on a previous buy order block which is constant or doesn't disappear/vanish and the other indicator Bheurekso must have given an arrow signal of opposite
I want to develop a trade copier that copies trades from master account to client and also from client account to master account. It should be working on computer or VPS
Wirtschaftskalender 50 - 200 USD
1) Einbinden des Wirtschaftskalender ( https://www.mql5.com/de/economic-calendar ) 2) Unterschiedliche Gewichtung der Ereignisse erkennen (Farbe rot/orange/grau) 3) Je nach Gewichtung unterschiedliche Wartezeiten vor und nach dem Ereigniss Der Sourcecode muss dokumentiert sein. Die Bezahlung des vereinbarten Betrages läuft in 33% Schritten ab. 33% bei Vergabe 33% bei Endabnahme (Version 1.0) 33% nach Abgabe des
Hi, This is my demand: Enhancement to an existing robot with the ability to modify the main time frame and indicators settings. Buy/Sell Stops are placed depending on candle positioning and a positive/negative Bulls Power. Trades are supplemented after reaching 10 points of profit. The robot should also support a balance option for propfirm accounts, switchable to use real account balance when needed. I will send
algo trading application want to developed Prerequisites for ordering a trading robot Trading robots are programs, which operate according to underlying algorithms. An algorithm is a set of actions that need to be performed in response to certain events. For example, the most common task in algo trading is the identification of the "New bar" event . When the event occurs, the robot checks the emergence of trading
I have list of free indicators in tradingview and i would like to convert them into an mt4 ea, But the EA will have and work based on the indicators features The list of the are listed as follows :> 1. Market Structure Break And Order block. By EmreKb 2. Rainbow Adaptive RSI by LuxAlgo 3. Multiple MA (21,50,100) 4. SuperTrend Please don't apply if can't do this, So we won't ourselves time
Hi I do not know why but my other order have been deleted and it's not me... I do not know what i did wrong, let me explain again. I dont want you to crack a code or decompile. I want to create a scalper EA with the option I do ask. I had somebody built a EA called Drawdown manager for me that I do use to manage risk of any EA that I test and I have the built code. My problem is that I cannot back test this EA Fast
CHAPTER 1: BASICS 1.THE BASICS 1.1. EXPANSION AND RETRACEMENT Expansion =>occurs when there is an impulse movement towards a direction. Retracement => is the correction movement after an impulse movement. 1.2. FIBBONACCI RETRACEMENT USED TO DETERMINE THE END OF THE RETRACTION MOVEMENT, USUALLY THE PRICE RETRACTS TO 50% OR UNTIL OTE (0.62, 0.705, 0.79) BEFORE ANOTHER IMPULSE MOVEMENT OCCURS. 1.3. BMS - BREAK IN MARKET
Am looking for a developer who can convert an MT5 indicator into MT5 EA. I have the source code of the indicator and i want it modified a little to fit my parameters. Only developer with Smart Money Concept should get in touch. The developer will also add another MT5 indicator( this will be used to confirm entries and exit of orders. More details to follow
I want a program that automatically disables manual trade execution once a specified number of trades have already been placed. ie. After a total of 3 trades have been placed on that day, manual trade execution should be disabled. I want the program to also limit the amount of lots that can be traded in any given day. ie. Maximum of 15 standard lots in any given day. The program should disable manual trade execution

Project information

Budget
100+ USD
VAT (19%): 19 USD
Total: 119 USD
For the developer
90 USD