Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 14:47:51 +0000



Post From: Major Issue: Incorrect Trade Execution Time between Live and Backtest after version 2192

[2020-11-24 12:23:22]
rahul - Posts: 160
Hello SC Engineers,

My code executes a market order when bar is closed. Before version 2192, the execution times were nearly the same but after version 2192 they are off by an entire second or more.
For example when I am using 1 minute chart timeframe, the order executed at 10:00:01 (which is similar to the backtest)...but now the order executes at 09:59:59 instead.
This is causing a big variance between backtest and live trading, which was not the case earlier.

bool Bar_Has_Closed = ((sc.GetBarHasClosedStatus(sc.Index) == BHCS_BAR_HAS_CLOSED) || (sc.GetBarHasClosedStatus(sc.Index) == BHCS_SET_DEFAULTS)) ? TRUE : FALSE;