Login Page - Create Account

Support Board


Date/Time: Mon, 03 Feb 2025 01:15:00 +0000



Post From: Discrepancies with backtesting an ACSIL trading system

[2019-10-13 20:40:28]
ForgivingComputers.com - Posts: 994
Assuming you declared PositionData somewhere:

s_SCPositionData PositionData;

You want to do sc.GetTradePosition(PositionData) every minute if you want to know the current PositionQuantity:


//Check this every minute

NewPossibleStop = currentLow + 30*sc.TickSize;
sc.GetTradePosition(PositionData);

if (PositionData.PositionQuantity <= -1 && NewPossibleStop < currentStop && NewPossibleStop < orderStop)
{
s_SCTradeOrder ExistingOrder;

// Then, you need to get the get order object ExistingOrder:

sc.GetOrderByOrderID(Stop1OrderID, ExistingOrder);

// Finally you check the status of the object ExistingOrder
// and test if it isn't filled


if (ExistingOrder.OrderStatusCode != SCT_OSC_FILLED)

{
s_SCNewOrder ModifyOrder;
ModifyOrder.InternalOrderID = Stop1OrderID;
ModifyOrder.Price1 = NewPossibleStop;

sc.ModifyOrder(ModifyOrder);
currentStop = NewPossibleStop;