Login Page - Create Account

Support Board


Date/Time: Sat, 08 Feb 2025 17:09:04 +0000



DTC How to Flatten

View Count: 916

[2020-06-09 11:41:34]
User667559 - Posts: 27
Is there a way to flatten a symbol via DTC?

I couldn't find anything, how is this supposed to be triggered? Or is it not available for now?
[2020-06-09 18:31:36]
Sierra Chart Engineering - Posts: 104368
Yes here is the message code:

const uint16_t SUBMIT_FLATTEN_POSITION_ORDER = 209;

And this is the data structure type:
s_SubmitFlattenPositionOrder

We will update the documentation today with details:

Order Entry and Modification Messages
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
[2020-06-10 09:06:56]
User667559 - Posts: 27
It doesn't seem to be working:
I have a position open on this symbol and on this account.

Sending to Sierra: {
Type: 209,
Symbol: 'NQM20_FUT_CME',
TradeAccount: 'Sim1',
ClientOrderID: 70722831972,
IsAutomatedOrder: 0
}

Getting back ORDER_UPDATE:
{
Type: 301,
RequestID: 0,
TotalNumMessages: 1,
MessageNumber: 1,
OrderStatus: 9,
OrderUpdateReason: 8,
OrderType: 0,
BuySell: 0,
Price1: null,
Price2: null,
TimeInForce: 0,
GoodTillDateTime: 0,
OrderQuantity: null,
FilledQuantity: null,
RemainingQuantity: null,
AverageFillPrice: null,
LastFillPrice: null,
LastFillDateTime: 0,
LastFillQuantity: null,
NoOrders: 0,
Symbol: 'NQM20_FUT_CME',
Exchange: '',
ServerOrderID: '',
ClientOrderID: '70722831972',
ExchangeOrderID: '',
LastFillExecutionID: '',
TradeAccount: 'Sim1',
InfoText: '',
ParentServerOrderID: '',
OCOLinkedOrderServerOrderID: '',
OpenOrClose: 0,
PreviousClientOrderID: '',
FreeFormText: '',
OrderReceivedDateTime: 0,
LatestTransactionDateTime: 0
}


I am able to open a new position via DTC on this symbol just fine.



Ps: the link to SUBMIT_FLATTEN_POSITION_ORDER is still missing on this page:
https://dtcprotocol.org/index.php?page=doc/DTCMessages_All.php
Date Time Of Last Edit: 2020-06-10 09:10:45
[2020-06-10 10:39:49]
Sierra Chart Engineering - Posts: 104368
I have a position open on this symbol and on this account.
Did you open the Position using the DTC server?
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
[2020-06-10 10:43:51]
User667559 - Posts: 27
yes, it makes no difference whether it's opened via sierra chart or via DTC. But that shouldn't make a difference I hope, Flatten is flatten I hope.
Date Time Of Last Edit: 2020-06-10 11:05:26
[2020-06-11 09:43:24]
User667559 - Posts: 27
I figured something out...

The Flatten command DOES work when I use Simulated Futures Trading of Sierra. It seems to be NOT working on the local Simulated Trading mode.

The command I send in both cases is exactly the same. The difference is the data feed and the local SIM on/off.

Any ideas on this one?
[2020-06-11 18:57:44]
Sierra Chart Engineering - Posts: 104368
Yes that does make sense since positions are tracked differently when in Trade Simulation Mode. But there should be a clear rejection text given and we need to look into why that is not the case.
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
[2020-06-13 07:13:25]
User667559 - Posts: 27
Well there's a big button called [Flatten] right inside Sierra that works perfectly fine during Simulation Mode On.

So instead of giving a more interesting rejection text, it would be nice to have it just work like it does within Sierra itself :)
[2020-06-15 00:07:00]
Sierra Chart Engineering - Posts: 104368
But that button is specific to an individual chart which the DTC Server does not have access to. The DTC Protocol Server operates completely independent from charts.

We did identify the why there was no rejection given and that will be fixed in the next release.
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
[2020-07-17 08:36:53]
User667559 - Posts: 27
When I flatten using DTC it doesn't remove the open and pending child orders when I have no current position. Could this behavior be changed so it behaves exactly like the [Flatten] button in Sierra itself?

Flatten should remove all orders, whether you have a position or not, now it's confusing to the user :)
[2020-07-17 10:44:16]
Sierra Chart Engineering - Posts: 104368
Yes we will look into this.
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

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

Login

Login Page - Create Account