The trading system based on TimeZonePivotsOpenSystem indicator signals with the possibility to set a fixed position holding time. The signal is formed when a bar is closing if there is a channel breakthrough. Once position holding time exceeds a preset fixed limit, the position will be closed immediately:
input bool  TimeTrade=true;      //Enabling position exit by time input uint  nTime=1500;         //Open position holding time in minutes
For the generated EA to operate correctly, the compiled TimeZonePivotsOpenSystem.ex5 indicator file should be available in the <terminal_data_directory>MQL5Indicators folder. The trading system is a further development of the Exp_TimeZonePivotsOpenSystem EA code by adding the ability to hold positions for a fixed time.
The EA works on timeframes not higher than M30:
input ENUM_TIMEFRAMES InpInd_Timeframe=PERIOD_M30;//TimeZonePivotsOpenSystem indicator timeframe
Default Expert Advisor’s input parameters have been used during tests shown below. No stop loss and take profit were used.Â
Fig. 1. Examples of trades on the chart
Testing results for 2017 at EURUSD M30:
Fig. 2. Test results chart