Support Board
Date/Time: Sat, 10 May 2025 22:31:21 +0000
Post From: ACSIL - modify Trail and Trigger offsets for Triggered Trail Stop
[2016-02-19 21:52:57] |
rhovega - Posts: 279 |
// Buy when the last price crosses the moving average from below. if (sc.CrossOver(Last, SimpMovAvgSubgraph) == CROSS_FROM_BOTTOM && sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED) { s_SCNewOrder NewOrder; NewOrder.OCOGroup1Quantity = 1; NewOrder.OrderType = SCT_ORDERTYPE_OCO_LIMIT_STOP; NewOrder.TimeInForce = SCT_TIF_GTC; NewOrder.Price1 = 32; NewOrder.Price2 = 31; That generated a buy after moving average crossed from below at bar close. At market I believe. I expected to create an OCO limit at 32 and a stop at 31, rather than buying at market (@31.66). It generated no record in either the Trade Service Log nor the Trade Activity Log. Do not understand how can it be that it shows no record. The position created by this does show under Trade Stats for Charts. Simply used the simplest template in tradingsystem.cpp and inserted the s_SCNewOrder NewOrder above (attached just in case). The example in scsf_ACSILTradingOCOExample is not applicable. It uses SCT_ORDERTYPE_OCO_BUY_STOP_SELL_STOP. The purpose is creating an OCO bracket only, not an order with an OCO bracket attached. Date Time Of Last Edit: 2016-02-19 23:39:49
|