Building a ZigZig_EA MT5

MQL5 Experts

Termos de Referência

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.

Arquivos anexados:

ZIP
MQL5.zip
13.0 Kb

Respondido

1
Desenvolvedor 1
Classificação
(167)
Projetos
192
11%
Arbitragem
37
38% / 35%
Expirado
5
3%
Trabalhando
2
Desenvolvedor 2
Classificação
(12)
Projetos
12
25%
Arbitragem
1
0% / 100%
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(155)
Projetos
239
70%
Arbitragem
3
67% / 33%
Expirado
20
8%
Livre
4
Desenvolvedor 4
Classificação
(363)
Projetos
389
70%
Arbitragem
3
100% / 0%
Expirado
2
1%
Carregado
5
Desenvolvedor 5
Classificação
(41)
Projetos
88
14%
Arbitragem
30
30% / 53%
Expirado
36
41%
Trabalhando
Pedidos semelhantes
MT4 EA Trade one zigzags 100 - 150 USD
I am looking for a programmer to do EA trader. If you can understand what I want from the video i do and you can do it, contact me because you will be able to do what I want. https://drive.google.com/file/d/1wbHxbUQQqCkdpr0-pHfIh2b288LzYTV2/view?usp=sharing
I need A Ea For Parabolic SAR With Default Settings And That Ea Including Take Profit And Stoploss Levels. Take profit : 50 points Stop loss : 50 points I have been seen that ea in Mql5 Market I tested it but that ea stop loss and take profits not activated that's why I came here I need a demo for testing process if you gave demo 1st and I will set you as a person to create a ea
Modifying an expert advisor written in mql5 and adding new indicators to it. The result must work both on strategy testing and on live, with no compilation errors and no warnings
see trade open on every tick seconde ok forex pair us us30 if is current running at 40170.00 so open 2 trade buy stop and sell stop both in every tick pending order of buy stop will 40171.00 and sell stop pending order will be 40169.00 buy stop will open at 40171.00 and tp will be 40173.00 and SL will be 40169.50 ok if buy stop hit sell stop order automatically will be close now if sell stop order open at 40169.00 so
Hi, I have an indicator from my friend, I want to copy it to MT5 can you do that for me. Here is the link
I'm seeking assistance in developing a sophisticated trading robot with the following features: Core strategy: Harmonic pattern recognition Supply and demand analysis Fibonacci zigzag for trade optimization Additional components: News filter Dashboard for easy monitoring Customizable settings: Lot size Trailing stop Trading session parameters Maximum number of orders Option to use market or limit orders Resources
1. Add Feature For (SPREAD) Normal trading Hours Spread or User set trading Hours Spread True or false Set to true or False When set to true EA will only create or develop a trade if spread is in this window allowing it to and EA will follow a window in which it can trade based on spread so if spread is to high and outside of this window it will not create a trade It
Hi, I have an indicator from my friend, I want to copy it to MT5 can you do that for me. Here is the link
Hi, I have a working MQ4 EA (With a few warnings but works fine), I need the warnings cleared and converted to MQ5. But I would also like a few improvements first. Firstly: Fix warnings in MT4 code (return value of 'OrderSelect'/'OrderModify' should be checked). Add following features: Magic number modifiable variable (It's currently hard coded) Is it possible to have a stop loss dollar amount instead of lots if
i create a robot which help with order blocks and detection of spikes ....simply it analyses the market for you and if you are using it you wont need much skill to start operating it well you just need to know and understand how it works

Informações sobre o projeto

Orçamento
100+ USD
IVA (19%): 19 USD
Total: 119 USD
Desenvolvedor
90 USD