Support Board
Date/Time: Fri, 27 Dec 2024 18:42:47 +0000
Post From: Issue with sc.ActiveToolYValue and Limit orders
[2016-03-08 02:46:18] |
rhovega - Posts: 279 |
I spotted an issue entering limit orders with attached orders using sc.ActiveToolYValue. The following Limit order enters a limit order at the last level clicked on the chart upon selecting chart custom menu "MenuIDXXX". if (sc.MenuEventID != 0 && sc.MenuEventID == MenuIDXXX) { s_SCNewOrder NewOrder; NewOrder.OrderQuantity = 1; NewOrder.OrderType = SCT_ORDERTYPE_LIMIT; NewOrder.Price1 = sc.ActiveToolYValue; NewOrder.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT; NewOrder.AttachedOrderStopAllType = SCT_ORDERTYPE_STOP; NewOrder.Target1Price = 1.2; NewOrder.StopAllPrice = 1.1; int Result = sc.BuyEntry(NewOrder); } Its a BuyEntry, so if I click above the current price, the limit order will execute at market. Say price is at 1.1025. If I click on 1.1050, the limit will create a BuyEntry at 1.1025. The issue is that the system modifies the attached order prices by 25 pips, rather than leaving them at 1.2 and 1.1. Attached order prices are specified as fixed absolute levels, rather than offsets, so I don't see why the system is modifying the levels. |