Determine whether the running environment of the strategy is a backtesting system.
The strategy returns a true value, e.g.: true
when running in the backtesting system environment. The strategy returns a false value, e.g.: false
when running in a live trading environment.
bool
IsVirtual()
function main() {
if (IsVirtual()) {
Log("The current backtest system environment.")
} else {
Log("The current live trading environment.")
}
}
def main():
if IsVirtual():
Log("The current backtest system environment.")
else:
Log("The current live trading environment.")
void main() {
if (IsVirtual()) {
Log("The current backtest system environment.");
} else {
Log("The current live trading environment.");
}
}
Determine whether the current running environment is a backtesting system, which is used to be compatible with the difference between backtesting and live trading.
Sleep Mail