On the Command Centre you can specify how often you want Auto-trading and/or Alerts to kick off.
Plus, on each individual Trading System and Alert, you can specify how often you want it to do auto-trading or alerting.
This article hopes to explain the relationship between the two settings. For brevity, I will just talk about Trading Systems, but it applies to Alerts also. The Command Centre window "Auto-trading" tab will be abbreviated to CCAT, and the Trading System window "Accounts & Currencies" tab will be abbreviated to TSAC.
Let's assume your system uses 1-Minute bars. 1-Minute bars is a very short time-frame, so I think you need to kick things off quite often.
If you imagine the scenario where on the TSAC you set your Trading System to run every 1 minute, and on the CCAT also set Auto-trading to kick off every 1 minute.
The first time Auto-trading kicks off at 12:00, a fraction of a second later it starts off your Trading System. So your Trading System is started at 12:00:00.001.
At 12:01, the next time Auto-trading starts, it is not going to start your Trading System. Because it is not 1 minute since it was last kicked off. It is 59.999 seconds.
At 12:02, the next time Auto-trading starts, it will start your Trading System. That's effectively 2 minutes since the last time.
Now let's change the CCAT setting to 5 seconds. The result is:
Auto-trading starts at 12:00. System is kicked off at 12:00:00.001.
Auto-trading starts at 12:00:05. Nothing to do.
Auto-trading starts at 12:00:10. Nothing to do.
Auto-trading starts at 12:00:15. Nothing to do.
And so on...
Auto-trading starts at 12:01. Nothing to do. It is "only" 59.999 seconds since it was last done.
Auto-trading starts at 12:01:05. System is kicked off at 12:01:05.001, effectively 1 minute and 5 seconds since the last time.
Most likely the next time through, that trading system will also be kicked off 1 minute and 5 seconds since the last time.
So, there is a creep forward effect. Your trading system is not trading every 1 minute as you specified, it is trading every 1 minute and 5 seconds. To get around it, maybe on the TSAC use the setting of 55 seconds instead of 1 minute.
This time at 12:00:55 there is nothing to do because it is 54.999 seconds since it was last done. But at 12:01, it is now 59.999 seconds (effectively 1 Minute) since the last time, our setting is 55 seconds, so the trading system is processed.
Now, I came to the value of 55 seconds by this formula:
How often I actually wanted the trading system to run minus How often auto-trading is kicked off.
That is, my wanted setting on the TSAC minus the setting on the CCAT.
And I thought about doing this automatically in the code, but that formula really only works if those two values fit nicely into each other. If you use a CCAT setting of 9 seconds, for example, then the formula would tell me to set the TSAC setting to 51 seconds. But actually that would result in the trading system doing auto-trading every 54 seconds. Not every 1 minute, and that instead would cause a "creep backward" effect.
In the end, armed with this knowledge about the possible creep forward or backward, you are just going to have make the best judgement about which TSAC setting is best based on your own CCAT setting.
For this particular example of using 1-Minute bars, I would do the following:
- On the TSAC, have your system do auto-trading every 55 seconds.
- On the CCAT, have it start Auto-trading every 5 seconds.
There is no harm in having a system which uses 1-Minute bars to do auto-trading more than once a minute. In fact this scenario is most likely unavoidable as you use longer and longer intervals such as Hourly or Daily.