Support Board
Date/Time: Sun, 22 Dec 2024 14:11:08 +0000
Post From: scale in question 3
[2015-04-24 04:01:27] |
onnb - Posts: 662 |
I have an ACSIL trading system that has sc.SupportTradingScaleIn = 1; I am seeing something strange. I submit a market order with attached stop and then I submit a limit order with attached stop. When the limit order gets filled, the stop order increments and all is working fine. Now I have another case where the first order submitted is a limit order. So in this case, I submit a limit order with attached stop that gets filled. Then there is a second limit order with attached stop that gets filled. In this case a separate stop order is created. Any ideas why? For what its worth, the order creation code posted below so you can see how the order properties are set. void TradeBase::InitMarketOrder(SCStudyGraphRef sc, float stop_price, s_SCNewOrder &order)
{ int quantity = GetMarketOrderQuantity(sc); order.OrderType = SCT_MARKET; order.OrderQuantity = quantity; order.Stop1Price = stop_price; } void TradeBase::InitLimit1Order(SCStudyGraphRef sc, float stop_price, s_SCNewOrder &order) { int quantity = GetLimit1OrderQuantity(sc); float price = GetLimit1Price(sc); order.OrderType = SCT_LIMIT; order.OrderQuantity = quantity; order.Price1 = price; order.Stop1Price = stop_price; } void TradeBase::InitLimit2Order(SCStudyGraphRef sc, float stop_price, s_SCNewOrder &order) { int quantity = GetLimit2OrderQuantity(sc); float price = GetLimit2Price(sc); order.OrderType = SCT_LIMIT; order.OrderQuantity = quantity; order.Price1 = price; order.Stop1Price = stop_price; } |