Discussion of article "MQL5 Wizard: How to Create a Module of Trailing of Open Positions"

 

New article MQL5 Wizard: How to Create a Module of Trailing of Open Positions is published:

The generator of trade strategies MQL5 Wizard greatly simplifies the testing of trading ideas. The article discusses how to write and connect to the generator of trade strategies MQL5 Wizard your own class of managing open positions by moving the Stop Loss level to a lossless zone when the price goes in the position direction, allowing to protect your profit decrease drawdowns when trading. It also tells about the structure and format of the description of the created class for the MQL5 Wizard.

Figure 1. Structure of the base class CExpert

Author: MetaQuotes

 

There is a oversight in code, if you open position with no SL, for short position CheckTrailingStopShort() won't change it.. (I set SL one bar after) 

should be:


if(position.StopLoss()<=open&&position.StopLoss()!=0.0) return(false); 

 

I guess good idea always use SL... Thanks for the article..

 

Thank you for your great and helpful article,

May I kindly ask you bring an example how could use this class in writing an expert adviser, my mean is that using this class in EA template not EA generate..

Thank you again,.. 

Reason: