Login Page - Create Account

Support Board


Date/Time: Tue, 30 Apr 2024 05:21:22 +0000



[Programming Help] - How to detect

View Count: 511

[2020-07-16 16:19:41]
j4ytr4der_ - Posts: 918
I'm working on a spreadsheet formula that would be able to detect orphaned orders, where there was an entry order but for whatever reason it's gone now and its OCO bracket (for example) might still exist. This is a situation that shouldn't happen, but occasionally has so I want an alert any time it could happen.

The easiest way to see this IMO is to create a simple bracket OCO with say a 20-tick offset, then place a long position followed by a short position. The two positions will cancel out, leaving only the brackets behind, for both orders.

Detecting the presence of working orders without a position is easy, but unfortunately that will also be true any time there is a legitimate limit order anywhere. And I can't figure out a way to detect only "child" orders vs. "parent" orders.

Is there any way to accomplish what I was looking to do, in detecting these "orphaned child orders"?
[2020-07-16 16:27:26]
Sawtooth - Posts: 3985
Orphaned child orders will show J8=0 and J84=1.
[2020-07-16 16:42:42]
j4ytr4der_ - Posts: 918
This is the problem I explained in the post. ALL limit orders will by definition evaluate that to true. They are not orphans, they are simply limits that have not yet been filled. So that won't work unfortunately. =(
[2020-07-16 17:05:08]
Sawtooth - Posts: 3985
limit orders will by definition evaluate that to true.

Include J4:

Orphaned child orders will show J8=0, J4=0, and J84=1.
Date Time Of Last Edit: 2020-07-17 04:51:56
[2020-07-16 20:01:22]
j4ytr4der_ - Posts: 918
Aha, I almost had that too... had a feeling J4 should be a factor but I didn't quite have it formulated right. Seems to work now... thanks so much for that!

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

Login

Login Page - Create Account