Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 18:24:11 +0000



Post From: C++ ACSIL OCO stop/limit order clean implementation

[2022-05-12 19:15:44]
Sergei Belov - Posts: 3
I am trying to implement OCO stop/limit order in C++/ ACSIL
for several days now and am using templates from TradingSystem.cpp
file which comes with the distribution.

I can show you my code for that with Message Log errors.
I tried 20 different combinations. All compile and produce some statistics.
The closest to correct implementation gives and error message
Trade Order Error - Invalid order prices relative to current price: 4035.25 | Symbol: [Sim]ESM22-CME
Buy Exit Price 4064.500000 TakeProfit 4077.000000 StopLoss 4070.750000

I tried all +1 and -1 factors and still getting the same error message

Another version I get OCO stop/limit order filled but next entry order failed

Maybe you already have some clean example of this

my code is very long but I am happy ton attach the relevant pieces