Login Page - Create Account

Support Board


Date/Time: Thu, 26 Sep 2024 23:31:22 +0000



ACSIL: modify order

View Count: 3614

[2013-11-01 22:14:28]
User40073 - Posts: 23
Hello,

How to identify lastest modified order?

I have a stop order, and I want to modify, and if the price is moved, then I'd like to modify again.

...
NewPrice = sc.Bid-sc.TickSize* Distance.GetDouble();
NewOrder.InternalOrderID = OrderID;  
NewOrder.Price1 = NewPrice;
int result = sc.ModifyOrder(NewOrder);
if (result>0) OrderID = NewOrder.InternalOrderID;
...
This code modify first, but my problem is, OrderID not changed, sc.GetOrderByOrderID(OrderID, TradeOrderData) give back 0, and my study run into my original first stop order which is check this:
if (!IsWorkingOrderStatus(TradeOrderData.OrderStatusCode))
{
NewOrder.OrderQuantity = 1;
NewOrder.OrderType = SCT_ORDERTYPE_STOP;
NewOrder.Price1 = sc.Ask+sc.TickSize*Distance.GetDouble();
int Result = sc.BuyEntry(NewOrder);
if (Result > 0 && NewOrder.InternalOrderID != 0) OrderID = NewOrder.InternalOrderID;
}

So I cant recognize my order.:(

thanks
[2013-11-03 19:56:22]
Sierra Chart Engineering - Posts: 104368
The InternalOrderID usually does not change during the life of an order unless the order goes to a not working state and then becomes reactivated.
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
[2013-11-03 20:19:48]
User40073 - Posts: 23
How to find the fresh actual working order (stop/limit or market)?
[2013-11-04 09:57:11]
User40073 - Posts: 23
Ok, I found the problem. On Backtest or SIM trade everything is fine, but real trading (LMAX) modify order, not modified, but cancelled and remaked order therefore I lose order ID.
I attached screenshot.
imageSC_modify.jpg / V - Attached On 2013-11-04 09:57:06 UTC - Size: 86.46 KB - 525 views
[2013-11-04 17:45:12]
Sierra Chart Engineering - Posts: 104368
In the case of LMAX, the Internal Order ID does change when modifying a Stop order because LMAX does not support modification of stop orders. We first have to cancel the order and issue a new order.

It is not possible after a modifying a Stop order through LMAX to immediately get the new internal order ID like this:
int result = sc.ModifyOrder(NewOrder);
if (result>0) OrderID = NewOrder.InternalOrderID;

So therefore, after the order modification is complete you would need to iterate through the orders using this function:
http://www.sierrachart.com/index.php?l=doc/doc_ACSILTrading.html#GetOrderByIndex

to find the particular stop order you are looking for.
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: 2013-11-04 17:45:28
[2013-11-06 08:43:26]
User40073 - Posts: 23
I coded this snippet to get real order ID, and if I havent got running order, get back zero.

int GetOrderID(SCStudyInterfaceRef sc)
{
  int Index = 0;
  int ID=0;
  s_SCTradeOrder OrderDetails;
  while( sc.GetOrderByIndex (Index, OrderDetails) != SCTRADING_ORDER_ERROR)
    {
     Index++; // Increment the index for the next call to sc.GetOrderByIndex

     if (OrderDetails.OrderStatusCode != SCT_OSC_OPEN && OrderDetails.OrderStatusCode != SCT_OSC_FILLED) continue;
     if (OrderDetails.ParentInternalOrderID != 0) continue;
     //Get the internal order ID
     ID = OrderDetails.InternalOrderID;

    }
  sc.GetOrderByOrderID(ID, OrderDetails);
  if (OrderDetails.OpenClose == OCE_CLOSE) ID=0;  
  return(ID);
}

Its ok, but I use attached orders, upset the whole code block.
Is there any easy way to get no order, all closed. (no stop/limit, openedetc...)
Other question is, how to get attached orders ID(takeprofit, stoploss) via OrderID? I'd like to get my TP/SL prices.

thanks!
[2013-11-06 22:04:32]
Sierra Chart Engineering - Posts: 104368
The proper solution is that we need to make sure the Internal Order ID does not change. We should be able to accomplish that. Please give us about a week. And check back with us.

When you submit orders, the Internal Order IDs are set and you can get them. When they do not change, you can always rely on them. And then you can get the order data using a specific order ID.
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: 2013-11-06 22:14:49
[2013-11-07 08:20:35]
User40073 - Posts: 23
Nice, I waiting for new SC update. Thanks for your helping.
[2013-11-11 09:23:17]
User40073 - Posts: 23
The new version (v1045) includes appointment at above?
[2013-11-11 09:31:52]
Sierra Chart Engineering - Posts: 104368
Not yet. We are trying to get this done before the end of the week.
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
[2013-11-15 20:53:20]
Sierra Chart Engineering - Posts: 104368
We are doing our best to get this done. This requires more in-depth analysis and we do not think we are going to complete this until next week.
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
[2013-11-19 19:31:19]
User40073 - Posts: 23
Any news with this case?
[2013-11-21 01:49:35]
Sierra Chart Engineering - Posts: 104368
Not yet. Should be before the end of the week though.
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
[2013-11-22 20:59:08]
Sierra Chart Engineering - Posts: 104368
We have finally completed this. The internal order ID does not change when modifying an order with LMAX. Normally this is the case with most services but there was a special case that had to be handled with LMAX.

This change will be out later today in version 1051.
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: 2013-11-22 20:59:55

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

Login

Login Page - Create Account