Login Page - Create Account

Support Board


Date/Time: Mon, 10 Mar 2025 03:03:41 +0000



Post From: Orders not Cancelling (fast replay) + Checking if existing working order or filled order

[2022-03-12 10:21:03]
User431178 - Posts: 612
Any ideas on how to check (programatically) whether there is already an order (that is placed (not filled) or in the market until exited) instead of using my global variable ?

Did you consider using trade position information?
Automated Trading From an Advanced Custom Study: Getting Trade Position Data


This bit of code seems to have some problem, whenever i do a replay at high speed. Any ideas why ?

Not a solution, but you could add some debug logging to the cancel order function and see what the error code is.


auto result = sc.CancelOrder(BuyInternalOrderID);

if (result < 0)
sc.AddMessageToTradeServiceLog(sc.GetTradingErrorTextMessage(result), 0, 1);
else
{
ActiveScalpPresent = false;
SCString DataString;
DataString.Format("Buy Order Canceled due to condition changed, Scalp Is Available to use Now !");
sc.AddMessageToLog(DataString, 1);
}