Support Board
Date/Time: Tue, 21 Jan 2025 04:06:41 +0000
[Programming Help] - ACSIL Trading System: Attached Orders and Reversals
View Count: 1263
[2018-07-24 16:23:19] |
User41727 - Posts: 124 |
I have an automated trading system system that does entries via stop orders that either need to be triggered during the current bar or else will be cancelled. These parent orders each have an attached stop/limit bracket and are submitted via BuyEntry/SellEntry. The situation can now arise that there is an existing position, but an entry signal in the opposite direction is triggered. What I would like to do is to create the respective stop entry order with its attached bracket that, if triggered, flattens the existing position, cancels the remaining previous bracket orders, opens the new position and establishes the correct new bracket orders. If the order is not triggered, it and its attached orders should be cancelled and the previous bracket orders should continue to work. The problem is this: If I set SupportReversals = true as well as CancelAllOrdersOnReversals = false, then the previous position is flattened as soon as the new entry order is submitted, regardless of whether it will actually be triggered or not. If I set CancelAllOrdersOnReversals to false, I have to enable AllowEntryWithWorkingOrders, because otherwise the new entry order is rejected. If I do it this way, the old position will only be flattened if the new entry order is triggered. However, the new position will have the wrong quantity and no attached bracket order. So, my question is whether what I would like to do is possible this way without managing all of the orders manually. |
[2018-07-30 09:00:39] |
@sstfrederik - Posts: 405 |
You can set these variables outside the default block and use them under different circumstances. You will likely need to track more than a few things to make it work. Frederik Maybe you want to stop coding and use the SST autotrader study where this is supported: https://www.simplesystemtrading.com/automated-trading/ |
To post a message in this thread, you need to log in with your Sierra Chart account: