Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 01:52:14 +0000



Post From: Issues about sc.CancelAllOrders()

[2024-07-10 15:09:35]
ForgivingComputers.com - Posts: 960
// Generally you want to return in this conditional:
if (sc.IsFullRecalculation || sc.ChartIsDownloadingHistoricalData(sc.ChartNumber)) {
return;
}

// Then check if in a position and working orders
s_SCPositionData PositionData;
sc.GetTradePosition(PositionData);
int Open_Position = PositionData.PositionQuantity;

if (!Open_Position && PositionData.WorkingOrdersExist) {
sc.CancelAllOrders();
}