Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 02:34:03 +0000



Post From: TRAILING STOP TRIGGER

[2018-03-29 22:16:14]
User28317 - Posts: 147
We compile our order with the following code:

order.Target2Price = t.target_;
order.Stop2Price = t.stop_;
order.OCOGroup2Quantity = t.amount_ / 2;
order.AttachedOrderTarget2Type = SCT_ORDERTYPE_LIMIT;
order.AttachedOrderStop2Type = SCT_ORDERTYPE_STOP;

order.Target1Price = t.entry_ + t.risk_;
order.Stop1Price = t.stop_;
order.OCOGroup1Quantity = t.amount_ - (t.amount_ / 2);

order.TriggeredTrailStopTrailPriceOffset = t.trailingDistance_;
order.TriggeredTrailStopTriggerPriceOffset = t.target_ - t.stop_;

order.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;
order.AttachedOrderStop1Type = SCT_ORDERTYPE_STEP_TRAILING_STOP;

Which should trigger the trailing on reaching the value t.target_

It seems that this doesn't happen sometimes, with the trailing not
starting even when the trigger value is reached.