Login Page - Create Account

Support Board


Date/Time: Thu, 08 Oct 2026 13:53:22 +0000



Post From: Study has issue with submitting orders

[2026-04-26 16:00:53]
ForgivingComputers.com - Posts: 1239
Your success/fail test is incorrect.

if (resultS == 0) {
if (sc.Index == sc.ArraySize -1)
{
//Add error message to the Sierra Chart Message Log for interpretation
sc.AddMessageToLog(sc.GetTradingErrorTextMessage(resultS), 0);
sc.AddMessageToLog("FAILURE", 1);
}
} else {
sc.AddMessageToLog("SUCCESS: Sell Entry Order Submitted!", 1);
}

Success is if (resultS > 0) and fail if (results <= 0).

Also, without seeing the entire study, it is unclear why you cannot use this on two charts. However, if they share the same symbol and account, the position data may be causing the other one to fail.