ChannelEA1 – expert for MetaTrader 5

  • A+

The Expert Advisor works in a channel drawn by the ChannelInd indicator.

The indicator itself is not required for the EA operation, since its data are calculated inside the EA.

The EA trades on a time basis: at the trading time, which is specified in the EA settings, the EA places two pending limit orders on the borders of the channel and sets Take Profit levels on the opposite side of the channel, without a Stop Loss. At the end of trading time, all existing positions are closed and the orders that have not triggered are deleted.

Please note that the Expert Advisor is designed for training purposes.

The Expert Advisor has eight input parameters:

  • Begin hour - trading start time
  • End hour - trading end time
  • Experts magic number - the unique identifier of the EA's positions;
  • Lots - the volume of positions to open;
  • Slippage of price - maximum allowable slippage when opening a position;
  • Multiplier spread for stops - spread multiplier applied in the calculation of a proper distance for stop orders (*).
  • Waiting for environment update (in seconds) - time in seconds to wait for the update of the trading environment (**);
  • Number of attempts to get the state of the environment - the number of attempts to obtain an accurate trading environment (***).
* For pending orders (as well as Stop Loss or Take Profit), there is a minimum allowed distance for placing stop orders - StopLevel. I.e. the pending order (as well as Stop Loss or Take Profit) cannot be placed closer than this distance to the price. If StopLevel is zero, it does not mean its absence, it only means that StopLevel is floating. In this case, the minimum distance is usually equal to spread*, but sometimes even the double spread is not enough. So, this parameter allows specifying a custom multiplier for the spread used to calculate the minimum distance for placing pending orders.
** When a trading order is sent to a server, an occasional delay in execution may lead to an incorrect counting of the number of market positions. If such an "undefined" state is detected, the Expert Advisor waits for the specified number of seconds and then reads the environment again.
*** The number of waiting periods within one tick is set in the EA parameters. After taking all allowed attempts to get the accurate environment, the Expert Advisor exits processing and waits for the next tick. The EA will repeat these attempts on this new tick if the trading environment fails to update by this time.

To check the strategy, testing with default settings was performed using data in the interval from 2017.01.02 to 2018.03.29. Unfortunately, the EA did not show good results with default settings. Therefore the trading start and trading end parameters (Begin hour and End hour) were optimized on EURUSD H1 in the 1 minute OHLC mode. The results were better this time:

ChannelEA1 - expert for MetaTrader 5

ChannelEA1 - expert for MetaTrader 5


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: