Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 08:32:18 +0000



[Programming Help] - Send Attached Orders Not Working

View Count: 883

[2020-09-17 18:13:00]
User848713 - Posts: 16
Hello,

My auto trade system via spreadsheet trading was running Live today. It my first 5 orders or so worked correctly, but the last trade of the day did not have an OCO attached do it. It sold short and then was just left without a stop or profit target.

I looked through the trade service log but cannot figure out why. I have not had this problem before and did not change anything between trades that fun ruined correctly and the other that didn’t.

Do you have any ideas of what I should do/check?

Thanks for your help.
[2020-09-18 10:10:06]
Sierra Chart Engineering - Posts: 104368
You can determine the reason by looking at the Order Action Source field for the order in the Trade Activity Log:
Trade Activity Log: Viewing Historical Trade Activity

If you have Scale In enabled, there should be text within that field indicating that and whether Attached Orders were enabled or not.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-09-18 10:11:18
[2020-09-18 12:14:17]
User848713 - Posts: 16
Thank you.

It just says “Transact order up update. Status: 3” but does not show anything about attached orders (for the trades where attached orders did work and for the trade where it did not work).
Date Time Of Last Edit: 2020-09-18 12:14:30
[2020-09-18 13:05:49]
User848713 - Posts: 16
Question follow up - does for time to end/start in cells J85-J85: I have the end time set to 8:00:00 Chicago time. If my system is long or short and has already sent the target/stop orders, will they be cancelled at the trading end time? Or are new orders simply stopped from initiating but working orders remain active? (They are OCO)
[2020-09-18 18:27:36]
Sierra Chart Engineering - Posts: 104368
You need to look at the line in the Trade Activity Log for the order submission. Not a remote order update. So you are looking at the wrong line in the Trade Activity Log.

If my system is long or short and has already sent the target/stop orders, will they be cancelled at the trading end time?
No.

Or are new orders simply stopped from initiating but working orders remain active?
Yes. But those Attached Orders would expire at the end of the day if they have a time in force of Day.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-09-18 18:32:36
[2020-09-18 18:39:47]
User848713 - Posts: 16
I’m sorry I can’t find it. What is the name of the column I should look for in the trade activity log?
[2020-09-21 16:08:00]
User848713 - Posts: 16
Follow up number 2:
I had the same issue today. I contacted TransAct and they did not receive the attached/bracket order on their side which means nothing was sent from Sierra. This only happens intermittently though. Sometimes the attached order transmits and sometimes it doesn’t (within the same trading day on the same product, with no settings being changed).
[2020-09-21 21:26:36]
Sierra Chart Engineering - Posts: 104368
You need to look at the Order Action Source field:
Trade Activity Log: Viewing Historical Trade Activity

If attached orders are attached, you would see AO=1 in that field text. If you do not see that, it means the option for Attached Orders was not enabled:
Attached Orders: Step-By-Step Instructions
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-09-21 21:27:20
[2020-09-22 04:14:15]
User848713 - Posts: 16
Thank you. So attached orders are enabled and it does list AO=1.

In looking at the order activity, it seems as though the attached orders are cancelled before the trade entry is actually filled (example below). I am using the “Cancel Unfilled Order After N Bars” example formula as referenced here:


Spreadsheet Example Formulas and Usage: Cancel an Unfilled Order After n Bars

I’m using:
Cell P3: =IF(K3, 1, P4 + 1)
Cell Q3: =IF (M3, 1, Q4 + 1)
Cell J27: =OR(AND(P4 >= H4 + 1, J4
> 0), AND(Q4 >= H4 + 1, J4 < 0))
Cell H4: = 3

Note: this is on a 10 second chart.

From the log, a sell entry is triggered (where AO=1), then cancel working orders is initiated based off of cell J27 less than 1 second later, then I am filled on my limit sell entry but no attached orders are present because they were already cancelled. All of this happens in fractions of a second.

Specific example:
Sell signal at 06:22:30:980
Attached/working orders canceled are 06:22:31:350
Filled on short entry at 6:22:31:370 without attached orders because they were already cancelled

Any ideas how to fix this? This does not happen on every trade, but intermittently.

Secondly, is J27 meant to cancel working orders that we’re attached to a filled order or all working orders?
[2020-09-22 12:43:36]
Sawtooth - Posts: 3976
Any ideas how to fix this?
- Does this ever happen in chart Replay, and will it repeat each time you replay the same entry?
It's difficult to troubleshoot if you can't reliably duplicate the event.

- Are your entries at close of bar?
The “Cancel Unfilled Order After N Bars” example assumes so.

- Would this happen if the bar period was longer?
Depending on the market, 10 sec bars may not populate exactly on time if there is no chart update.

- Is 'Cancel All Working Order On Exit' set to Yes, and are there formulas in L3/N3?
You could start to isolate the trouble by removing formulas in J27, L3, or N3, to see if the cancellation is coming from that cell.

- Are you using Reversals, and are any of the three 'Cancel All Orders On ... set to Yes?
Opposite signals will cancel current orders.

Since this trouble is occurring within a second or two, all of the above suggestion are based on signals flashing somewhere that might interrupt the expected sequence.

is J27 meant to cancel working orders that we’re attached to a filled order or all working orders?
J27 cancels all working orders, including those attached to a filled order.
J78 only cancels working orders that are not attached to a filled order.
[2020-09-22 14:58:58]
User848713 - Posts: 16
Entries are not set for at close of bar.

Reversals are not enabled.

CancelAll Working Orders on Exit is not enabled. Instead, OCO is used for the Attached Orders within three Attached Trade Window

I do not have exit orders in L3 or N3. I only have buy and sell entries (K3 and M3). My exits are meant to be the attached orders sent via the Attached Trade Window. Is this an issue? Again, the attached orders are working sometimes but not every time as described previously, that’s the weird part. According to the log, the orders are being cancelled via J27 as described above.

I am performing chat replay to try and isolate the problem. While I do that, I’m curious, in general, is it better to have exit orders defined in L3 and N3 instead of using attached orders via the trade window?

Re: 10 seconds bars: would making my charts update more frequently help?
[2020-09-22 15:23:14]
User848713 - Posts: 16
Follow up: the issue does not happen in chart replay. When I backtested my system prior to switching to Live I did not have the issue either, it has only come up since switching to live.
[2020-09-22 18:42:18]
Sawtooth - Posts: 3976
is it better to have exit orders defined in L3 and N3 instead of using attached orders via the trade window?
My preference is to use Attached Orders when ever possible because there will be at least a stoploss in the market.

10 seconds bars: would making my charts update more frequently help?
I was thinking that bars longer than 10 sec might not exhibit the problem.
But I'm not sure a shorter Chart Update Interval would matter, if the problem only happens in live trading.
Chart Settings: Chart Update Interval in Milliseconds (Chart >> Chart Settings >> Display >> Chart Update Interval menu)
[2020-09-24 16:33:22]
User848713 - Posts: 16
Thanks for the ideas and help.

While I still can’t find the source of the problem, I enabled “Signal Only on Bar Close” for my buy and sell entries and have not had the attached order issue for the last 2 live trading days. My trading system isn’t dependent on intra-bar signals so I will keep it with these new settings and hopefully the issue is resolved.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account