Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 08:51:15 +0000



[Programming Help] - Problems adding limit orders

View Count: 291

[2023-09-06 01:04:31]
WeroTrader - Posts: 46
Greetings, Sierra Chart team.

I am trying to place two limit orders (one to buy and one to sell) via ACSIL in the same index.

The orders are placed correctly, but they are added, without me having requested it, two additional close orders for each one, one limit type and another stop type; the status of these additional orders is "Pending Child-Client", with zero quantity.

How can I make sure that those additional orders are not placed? This is causing me that when the "correct" order is filled, it is immediately closed.

I am not looking for code, just a correct guide about the instruction that I must follow for the correct handling of limit type orders.

I leave an example of the code for the sales order.



s_SCNewOrder Order_SellGRID;

Order_SellGRID.Symbol = Symbol;
Order_SellGRID.OrderType = SCT_ORDERTYPE_LIMIT;
Order_SellGRID.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED;
Order_SellGRID.OrderQuantity = Batch;
Order_SellGRID.Price1 = GridSell;

Result = static_cast<int>(sc.SellOrder(Order_SellGRID));


I attach images of the orders in the graph, as well as the information that appears in the window of trade orders; thank you in advance for the answer
imageTrade Orders.png / V - Attached On 2023-09-06 01:01:16 UTC - Size: 17.68 KB - 67 views
imageChild - Client.png / V - Attached On 2023-09-06 01:02:38 UTC - Size: 6.54 KB - 66 views
[2023-09-06 07:00:07]
User431178 - Posts: 543
Check out the two items below

ACSIL Interface Members - Variables and Arrays: sc.UseGUIAttachedOrderSetting
ACSIL Interface Members - Variables and Arrays: sc.SupportAttachedOrdersForTrading
[2023-09-06 14:03:23]
WeroTrader - Posts: 46
The thing is, the orders that appear with status "Pending Child-Client", I didn't attach them and I don't know the reason why they appear.

Is there anything else I can refer to to find the reason?
[2023-09-06 14:19:59]
User431178 - Posts: 543
So both of the above linked items are set to 0 then?
Date Time Of Last Edit: 2023-09-06 14:20:17
[2023-09-07 15:16:37]
Sierra_Chart Engineering - Posts: 17191
Yes set these both to 0 in the sc.SetDefaults code block :

sc.SupportAttachedOrdersForTrading = 0;
sc.UseGUIAttachedOrderSetting = 0;

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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2023-09-07 15:17:02

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

Login

Login Page - Create Account