It is absolutely impossible to answer the question: is a sharp price exit from the range associated with a new trend or a "black swan"? The price can leave for a few figures and immediately come back or leave and never come back again. It is impossible to detect it by technical means. Therefore, instead of getting into all sorts of trouble, it is more reasonable to proceed from the daily loss limit for setting a stop-loss.
removed all the risks there are 3 deals left :))))
The author does a good job of touching on an important topic. Imho, what is missing at the very beginning is a definition of "risk". There are several variants. And as a rule, they are related to the negative (loss-making) side of the coin. Although in the literature on financial mathematics there is also such a definition: "risk is any deviation of the financial result from the expected or average value". I.e. it emphasises not only the possibility to lose, but also the possibility to earn.
This style of programming is not approved.
MA4_cur_m15 = iMA(NULL,PERIOD_M15,4,0,MODE_SMA,PRICE_TYPICAL,0); MA4_prev_m15 = iMA(NULL,PERIOD_M15,4,0,MODE_SMA,PRICE_TYPICAL,1); MA4_2p_m15 = iMA(NULL,PERIOD_M15,4,0,MODE_SMA,PRICE_TYPICAL,2); MA5_prev_m15 = iMA(NULL,PERIOD_M15,5,0,MODE_SMA,PRICE_TYPICAL,1); MA8_cur_m15 = iMA(NULL,PERIOD_M15,8,0,MODE_SMA,PRICE_TYPICAL,0); MA8_prev_m15 = iMA(NULL,PERIOD_M15,8,0,MODE_SMA,PRICE_TYPICAL,1); MA8_2p_m15 = iMA(NULL,PERIOD_M15,8,0,MODE_SMA,PRICE_TYPICAL,2); MA8_cur = iMA(NULL,PERIOD_M1,8,0,MODE_SMA,PRICE_TYPICAL,0); MA8_prev = iMA(NULL,PERIOD_M1,8,0,MODE_SMA,PRICE_TYPICAL,1); MA8_2p = iMA(NULL,PERIOD_M1,8,0,MODE_SMA,PRICE_TYPICAL,2); MA8_3p = iMA(NULL,PERIOD_M1,8,0,MODE_SMA,PRICE_TYPICAL,3); MA5_cur = iMA(NULL,PERIOD_M1,5,0,MODE_SMA,PRICE_TYPICAL,0); MA5_prev = iMA(NULL,PERIOD_M1,5,0,MODE_SMA,PRICE_TYPICAL,1); MA5_2p = iMA(NULL,PERIOD_M1,5,0,MODE_SMA,PRICE_TYPICAL,2); MA13_cur = iMA(NULL,PERIOD_M1,13,0,MODE_SMA,PRICE_TYPICAL,0); MA13_prev = iMA(NULL,PERIOD_M1,13,0,MODE_SMA,PRICE_TYPICAL,1); MA13_2p = iMA(NULL,PERIOD_M1,13,0,MODE_SMA,PRICE_TYPICAL,2); MA60_cur = iMA(NULL,PERIOD_M1,60,0,MODE_SMA,PRICE_TYPICAL,0); MA60_prev = iMA(NULL,PERIOD_M1,60,0,MODE_SMA,PRICE_TYPICAL,1); MA60_2p = iMA(NULL,PERIOD_M1,60,0,MODE_SMA,PRICE_TYPICAL,2); MA24_cur_h1 = iMA(NULL,PERIOD_H1,24,0,MODE_SMA,PRICE_TYPICAL,0);
Arrays, loops, etc. Nicht used?
Is this really the "METATRADER 5 - TRADING" section?
Is this really the "METATRADER 5 - TRADING" section?
I suggest you rewrite the attached code in MQL5 and publish it in Codebase - we will add the link and the code itself to the article.
So, are there anyone willing to rewrite the EA code from the article into MQL5 language and upload it to KodoBase?
genius: " MACD-based expert does not have time to react to the sharp price collapse of the USDCHF pair"
thanks for the article.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article How to reduce trader's risks has been published:
Trading in financial markets is associated with a whole range of risks that should be taken into account in the algorithms of trading systems. Reducing such risks is the most important task to make a profit when trading.
One of the dangerous forms of a local trend reversal are the crashes and spikes with a large amplitude in a short time. The jump of one currency in a pair always means a collapse of another. It is especially dangerous if there is an open position and the direction of the collapse is unfavorable to it. In this case, a small deposit may be completely lost.
The essence of the problem
As a result, the market participants suffer huge losses. For example, on May 6, 2010, the Dow Jones index fell by 1000 points in 6 minutes, while, according to expert estimates, the market lost about a trillion dollars.
The more recent example (Fig. 6) is Brexit, which provoked the collapse of GBPUSD on June 24, 2016 by 560 points at once. 473 points from them were lost in one minute:
Fig. 6. GBPUSD price collapse on June 24, 2016
Author: Aleksandr Masterskikh