Support Board
Date/Time: Wed, 12 Mar 2025 16:53:41 +0000
Post From: C++ ACSIL OCO stop/limit order clean implementation
[2022-05-12 20:22:46] |
Sergei Belov - Posts: 3 |
Dar BradH I ran this example -- it now sends exit orders but immediately at current price without any offsets (losing 1 tick on every trade) even though I put TargetTicks to 50 and StopTicks to 25 You recommend NewOrder.OrderType = SCT_ORDERTYPE_LIMIT; Before I was using NewOrder.OrderType = SCT_ORDERTYPE_OCO_BUY_STOP_SELL_STOP; NewOrder.AttachedOrderStop1Type = SCT_ORDERTYPE_STOP; NewOrder.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT; NewOrder.Price1 = price - sc.TickSize * Stop_Level.GetFloat(); NewOrder.Price2 = price + sc.TickSize * Target_Level.GetFloat(); int Result1 = (int)sc.SubmitOCOOrder(NewOrder); I had a version before with behavior similar to your version (exit trades immediately without any offset) This should be something simple. I am pretty good in general C++ but just starting in Sierra Chart. I also have my own backtesting engine linked to 3 100TB of tick data and several quant strategies there (I have math PhD from MIT) -- happy to collaborate |