Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 18:34:41 +0000



Post From: Auto trade management reversal question

[2014-05-23 17:58:26]
onnb - Posts: 662
hi, I'm trying to confirm is there is I can use automated management for the following requirement:

Start out with state where we are flat

Need to have buy entry order + sell entry order working at the same time.
If one of these orders gets filled, need the other to continue working. Say I got filled and I am long and I have child orders working for this open position now.
If the sell order gets filled while I am long, need to reverse while canceling the long position attached orders.

I tried the following settings:

sc.AllowMultipleEntriesInSameDirection = 0;
sc.SupportReversals = 1;
sc.AllowOnlyOneTradePerBar = 1;
sc.SupportAttachedOrdersForTrading = 0;
sc.CancelAllOrdersOnEntriesAndReversals = 1;
sc.AllowEntryWithWorkingOrders = 1;

this means that I can't have a buy order and a sell order at once - right? Say if I first put on the buy order, when I put on the sell order the buy order gets canceled.

I tried these settings too:

sc.AllowMultipleEntriesInSameDirection = 0;
sc.SupportReversals = 1;
sc.AllowOnlyOneTradePerBar = 1;
sc.SupportAttachedOrdersForTrading = 0;
sc.CancelAllOrdersOnEntriesAndReversals = 0;
sc.AllowEntryWithWorkingOrders = 1;

This allows to have buy entry and sell entry orders on at once, but the reversal was a mess - still trying to figure out what happened but before going into that...

Looking to confirm if this scenario is generally supported with Auto trading and if I am doing the setting wrong or do I need to do some of this management on my own.

(Btw, from what I have seen so far, it would probably work if I had a setting in auto trade management that would CancelAllOrdersOnReverals but not cancel them on Entries)