Enivid

Administrator
Staff member
Nov 30, 2008
19,495
1,596
144
Odesa
www.earnforex.com

trader2trader

Newbie
Aug 21, 2024
4
0
2
27
Yes, that's most likely some issue with the Build 1421/1422. Please get an .ex4 compiled in 1420 from here:
https://github.com/EarnForex/AutoTrading-Scheduler/releases
EAs compiled in 1420 should work normally in 1421/1422.
Looks like still the same issue. Please can you explain in detail how to fix this with the 1420 .ex4 file.
I tried the following:
- Deleted existing .ex4 file in Expert folder and replaced it by the .ex4 file from the link you provided
- Deleted all AutoTrading Scheduler files in Expert folder and replaced it with compiled files from another MT4 client on my server which still runs on 1420 version
- Deleted all AutoTrading Scheduler files in Expert folder and replaced it with the all files of the zip folder you provided via the link.

Doesn't get it running unfortunately.
Same errors
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,495
1,596
144
Odesa
www.earnforex.com
Looks like still the same issue. Please can you explain in detail how to fix this with the 1420 .ex4 file.
I tried the following:
- Deleted existing .ex4 file in Expert folder and replaced it by the .ex4 file from the link you provided
- Deleted all AutoTrading Scheduler files in Expert folder and replaced it with compiled files from another MT4 client on my server which still runs on 1420 version
- Deleted all AutoTrading Scheduler files in Expert folder and replaced it with the all files of the zip folder you provided via the link.

Doesn't get it running unfortunately.
Same errors
Unfortunately, I cannot test this because this bug manifests itself on some CPU's only. What I'd do the following:
1. Remove all the ATS's code and the .ex4 file from your Expert folder.
2. Copy only the .ex4 compiled in 1420 from GitHub.
3. Don't copy any source files.

Then try attaching the EA again.
 

hvn000

Active Trader
Feb 7, 2016
1
0
32
65
For me, this scheduler only works on a demo account. It is not installed on a real account. MT4 Build 1428
On MT4, Build 1430 has been earned.
 
Last edited:

JanTarek

Trader
Dec 9, 2024
2
2
9
44
Would it be possible to add a choice in the next update for the non enforcing option to wait for open positions to close before switching auto trading off? I know this is possible with enforcing option but then you can't use any other EA which controls auto trading switch like news filter. Thank you.
 
Last edited:
  • ℹ️
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
19,495
1,596
144
Odesa
www.earnforex.com
AutoTrading Scheduler has been updated to version 1.04 to implement the following changes:
  • Added an option to close trades in the asynchronous mode in MT5.
  • Added input parameters to filter trades by magic numbers. (Via GitHub)
  • Changed the messages about disabled auto-trading to specify whether it is disabled in the platform or in the EA.
  • Changed how the EA works when Always enforce schedule is off and the WaitForNoPositions input parameter is set to true. It will now proceed to toggle auto-trading with a schedule period if it finds that there are no more positions after the period starts. (@JanTarek)
  • Fixed a crashing error that could occur when unticking the Always enforce schedule checkbox with an empty schedule.
 
  • 🎉
Reactions: EnrichWave

JanTarek

Trader
Dec 9, 2024
2
2
9
44
AutoTrading Scheduler has been updated to version 1.04 to implement the following changes:
  • Added an option to close trades in the asynchronous mode in MT5.
  • Added input parameters to filter trades by magic numbers. (Via GitHub)
  • Changed the messages about disabled auto-trading to specify whether it is disabled in the platform or in the EA.
  • Changed how the EA works when Always enforce schedule is off and the WaitForNoPositions input parameter is set to true. It will now proceed to toggle auto-trading with a schedule period if it finds that there are no more positions after the period starts. (@JanTarek)
  • Fixed a crashing error that could occur when unticking the Always enforce schedule checkbox with an empty schedule.
Thank you for the update. I have just tested the new version, unfortunately it doesn't change the way EA works for me with "Always enforce schedule" unchecked and "Switch A/T off only when there are no open positions" set to TRUE. Like with version 1.03 AutoTrading is being switched off only when the schedule period starts or ends. I tried it with the MT4 I'm currently using, also installed it fresh in a new one - in both cases got the same results. Perhaps there's something I'm missing?
 

Attachments

  • Screenshot_20250120-180510_Microsoft Remote Desktop.jpg
    Screenshot_20250120-180510_Microsoft Remote Desktop.jpg
    216.7 KB · Views: 1

chrisrazz

Newbie
Feb 20, 2025
2
0
1
65
Please correct me if wrong. I cannot see an option that will all close pending orders whilst allowing algo trading to continue if there is an open trade.

To clarify, I have a bot that allows the user to set trading hours but it is limited to one setting per day, eg Thurs 02-22. I have found a particular day that has x2 sessions within the day (02-06 and then 14-17) that are profitable, whilst, running the bot from 02-17 is not so much. The bot sets a number of pending orders and cancels them when inactive. An trade opened within the specified hours is allowed to run beyond the time setting and continues to be managed by the bot with trailing stops etc.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,495
1,596
144
Odesa
www.earnforex.com
Please correct me if wrong. I cannot see an option that will all close pending orders whilst allowing algo trading to continue if there is an open trade.

To clarify, I have a bot that allows the user to set trading hours but it is limited to one setting per day, eg Thurs 02-22. I have found a particular day that has x2 sessions within the day (02-06 and then 14-17) that are profitable, whilst, running the bot from 02-17 is not so much. The bot sets a number of pending orders and cancels them when inactive. An trade opened within the specified hours is allowed to run beyond the time setting and continues to be managed by the bot with trailing stops etc.
This cannot be done with the AutoTrading Scheduler. This should be coded in your main bot.
 

Alexandr 001

Newbie
Feb 27, 2025
5
0
1
54
Hi. I don't understand how to set the checkboxes? If the trading end time has come to an end but there are still open orders. The scheduler waits until all open orders are closed. As soon as the orders are closed, the adviser turns off. This is all clear. But how to delete pending orders after closing?
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,495
1,596
144
Odesa
www.earnforex.com
Hi. I don't understand how to set the checkboxes? If the trading end time has come to an end but there are still open orders. The scheduler waits until all open orders are closed. As soon as the orders are closed, the adviser turns off. This is all clear. But how to delete pending orders after closing?
If you tick the 'Attempt to close all orders before disabling Autotrading', it will both close positions and delete pending orders. If you set the WaitForNoPositions and WaitForNoOrders input parameters to true, it will wait until there are no positions and no pending orders before disabling autotrading.
 

Alexandr 001

Newbie
Feb 27, 2025
5
0
1
54
I have the setting 01:00-02:00. At 02:01, a deal closed in my terminal, but a pending order remained. Can the advisor (scheduler) delete this pending order?

Attempt to close???
 

Alexandr 001

Newbie
Feb 27, 2025
5
0
1
54
Close all positions before turning AutoTrading OFF? =true
Switch A/T off only when there are no open positions?=true
If this feature is enabled, in what order will the EA close orders?
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,495
1,596
144
Odesa
www.earnforex.com
I have the setting 01:00-02:00. At 02:01, a deal closed in my terminal, but a pending order remained. Can the advisor (scheduler) delete this pending order?

Attempt to close???
Once it turned autotrading off, it can no longer delete any orders. You need to check what happened by looking in the Experts and Journal tabs. Most likely, there was an error deleting the error and then it turned autotrading off. Another possibility, is that some other EA (re)created that order just in time before the ATS disabled autotrading.

Close all positions before turning AutoTrading OFF? =true
Switch A/T off only when there are no open positions?=true
For your case (if you want to wait until all pending orders are deleted), you also need to set this to true:
Switch A/T off only when there are no pending orders?=true
 
  • 👍
Reactions: Alexandr 001

chrissezhi

Trader
Jan 19, 2023
23
0
17
54
Hi Enivid - quick question - with the below. I want to close all orders before EA disables autotrading. I do not deal with pending orders. If I have an open trade and I have checked the box "Attempt to close all orders before disabling Autotrading" and set WaitForNoPositions to true, the EA will wait for the positions to be closed before disabling, is this correct?

If you tick the 'Attempt to close all orders before disabling Autotrading', it will both close positions and delete pending orders. If you set the WaitForNoPositions and WaitForNoOrders input parameters to true, it will wait until there are no positions and no pending orders before disabling autotrading.
 
Last edited by a moderator:

Enivid

Administrator
Staff member
Nov 30, 2008
19,495
1,596
144
Odesa
www.earnforex.com
Hi Enivid - quick question - with the below. I want to close all orders before EA disables autotrading. I do not deal with pending orders. If I have an open trade and I have checked the box "Attempt to close all orders before disabling Autotrading" and set WaitForNoPositions to true, the EA will wait for the positions to be closed before disabling, is this correct?

If you tick the 'Attempt to close all orders before disabling Autotrading', it will both close positions and delete pending orders. If you set the WaitForNoPositions and WaitForNoOrders input parameters to true, it will wait until there are no positions and no pending orders before disabling autotrading.
Yes, that's correct. What you have to be aware of is that if you have some another EA running that is actively opening new trades (orders or positions), the ATS may never have a chance to disable autotrading because it won't detect a situation when there are no trades.