Download MetaTrader 5

Examples: Two-Stage Modification of Opened Positions

To add comments, please log in or register
Documentation is available in CHM and PDF. Download it in any convenient form!
MetaQuotes Software Corp.
Moderator
181045
MetaQuotes Software Corp. 2008.07.01 11:06 

New article Two-Stage Modification of Opened Positions has been published:

The two-stage approach allows you to avoid the unnecessary closing and re-opening of positions in situations close to the trend and in cases of possible occurrence of divirgence.

The article named "T.DeMark's Approach to Technical Analysis" contains the recommended coefficients of the correction length, particularly 0.382 and 0.618. Using these coefficients during positions opening, you can avoid the unnecessary situations of closing and re-opening of positions in situations close to the trend. The function works well, especially in the situation of divergence occurring.

This approach, provided the profit value is reset, helps to detect the appearance of a "favorable" trend. For example, as it is shown in Fig.1 and compared to Fig.2.




Function Algorithm

The first modification of the order is performed by the specified TrailingStop value, the subsequent ones set the StopLoss smaller than the possible correction level by 1 or 2 points (in this case, the correction coefficient = 0,382 "Coeff_"). Increase the value of TakeProfit on every step by, for example, a half of the TrailingStop value (you can choose another value, too!). The value of TakeProfit can be changed, as well. For this purpose, zero value of the extern double March = 0; operator should be set at the beginning of the program.

It would be wiser for traders who prefer the address analysis-support of program-specific actions to be performed directly while trading, to transfer the MagicNumber variable into the code of the Expert Advisor itself, where the position is opened. You can read more detailed information about the specific address support in the book by S. Kovalyov published on the MQL4.com website.

Author: Genkov

Michael
685
Michael 2008.07.02 19:40  

So in an EA you would put this here:

int start()
{
   TrailingStop();
   if (funcIsNewBar())
   {
      //all kinds of checks to open new orders
   }
}
Correct?
MQL4 Comments
16319
MQL4 Comments 2008.07.03 14:47  

Get warning:

Start function not found and cannot be run.

Komgrit Sungkhaphong
160
Komgrit Sungkhaphong 2013.10.22 08:09  

yeah I think the same thing, nondisclosure.

it send modify function all the time??

Komgrit Sungkhaphong
160
Komgrit Sungkhaphong 2013.10.22 09:36  

and what is

(Pr_Op_0-Pr_Op_1)>2*Point

i don't see they got any value?

To add comments, please log in or register