A Simple Expert Advisor The EA opens a position of the specified type at the time specified in the EA parameters. The position is closed at the time specified in the appropriate parameter.
The purpose is to select the appropriate type of a position (either long or short) and to set position opening and closing time in hours and minutes. You can also set stop loss and take profit in points. If invalid Stop Loss and Take Profit values are specified, the EA will adjust the values to the minimum StopLevel allowed for the symbol.
The Expert Advisor will also adjust the lot in case an incorrect value is specified. If the lot is too large, the EA will adjust it in order to be able to open a position. If there is no money for opening even the minimum lot, the signal will be skipped.
The EA has a specific feature: if short stop orders are used and they trigger, a new position can be opened provided it is the same bar, on which the first position was opened at this time signal. In other words: if a position is opened at the current bar and is closed by the stop order, a new position will be opened if the new bar has not started yet, and so on until a new bar opens on the current timeframe.
The EA has 11 input parameters:
Two tests were performed in the Every Tick mode on EURUSD H1, using data in the interval from 2017.01.02 to 2018.01.19, in two modes: opening long positions and opening short positions. The EA showed good results in the Long Positions mode. This mode was additionally optimized in terms of position opening and closing hour.
The result of the EA testing with the opening hour set to 15 and closing hour set to 8, and default parameters is shown below:
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/19916
Implementation of multiple trailing types. Pending Buy Stop and Sell Stop orders. Limitation of the maximum total lot and the total number of positions. Several types of position volume calculation.Percentage_Crossover_Channel_EA
An Expert Advisor, which trades in a channel based on the Percentage_Crossover_Channel indicator.