Support Board
Date/Time: Sat, 23 Nov 2024 23:47:27 +0000
Post From: Error with Sim Lock & Orders being executed
[2024-06-29 08:12:58] |
User431178 - Posts: 541 |
The issue i'm having is that the Lock is getting set but the orders in the book are not cancelling. You need to cancel the existing orders yourself before locking trading. i'm using the following but think it might be interfering with a position limit set in global settings. Is there a way round this? sc.PlaySound("Alert1.wav"); sc.CancelAllOrders(); sc.FlattenPosition(); You want a check before you set the lock, to ensure that the positions / orders cancelled as expected. Additionally can I ask when testing this out in Replay mode, CurrentsystemDateTime Is the time based on Global settings time zone which I've got set to New York or Local time is UK. Assuming its NY but could be mistaken there. It is based on the timezone of the chart, so unless you have changed the chart separately, the golbal time zone setting. Also, there is the function sc.GetCurrentDateTime(), which returns the system time or the replay time automatically, depending on whether replay is running. |