Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 05:29:16 +0000



Post From: Stoploss rejected in ACSIL auto trading system

[2020-08-01 09:43:18]
User820318 - Posts: 40
Hi,

I am developing an autotrading system for ETH/USD via Bitmex and have been live testing for the last week. Just now I had a very unfortunate event. It would appear that as the system was making an order modification the stoploss order was rejected and the position was therefore left unprotected. Obviously this is unsustainable for any trading system. I have the below piece of code which is supposed to protect against having no stops however because the profit target order was still in place this failed to flatten the position. Do you have any advice as to how to prevent this kind of event from happening in the future?

Thanks in advance for your assistance.

// Flatten if position open with no working orders
  if (PositionData.PositionQuantity != 0 &&
    !PositionData.WorkingOrdersExist)
  {
    sc.FlattenPosition();
    sc.AddMessageToLog("Position exists with no working orders. Position was Flattened.", 1);
  }
Date Time Of Last Edit: 2020-08-01 09:46:42
imageInkedCapture_LI.jpg / V - Attached On 2020-08-01 09:46:11 UTC - Size: 5.34 MB - 231 views