Method CreateAsync
- Namespace
- WhalesSecret.ScriptApiLib.Backtest
- Assembly
- WhalesSecret.ScriptApiLib.dll
CreateAsync(BacktestConfig, CancellationToken)
Creates a new instance of the script API with initialized script environment with default create options.
public static Task<BacktestScriptApi> CreateAsync(BacktestConfig backtestConfig, CancellationToken cancellationToken = default)
Parameters
backtestConfigBacktestConfigConfiguration related to backtesting.
cancellationTokenCancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
- Task<BacktestScriptApi>
Script API with initialized and running script environment.
Exceptions
- MalfunctionException
Thrown if the initialization of core components fails.
- InvalidProductLicenseException
Thrown if the license provided in the options is invalid.
- FileAccessException
Thrown if it is not possible to create the data folder.
- AlreadyExistsException
Thrown if another instance is already operating on the given data folder.
- OperationCanceledException
Thrown if the operation was cancelled.
CreateAsync(CreateOptions, BacktestConfig, CancellationToken)
Creates a new instance of the backtest script API.
public static Task<BacktestScriptApi> CreateAsync(CreateOptions createOptions, BacktestConfig backtestConfig, CancellationToken cancellationToken = default)
Parameters
createOptionsCreateOptionsOptions to create Script API environment with.
backtestConfigBacktestConfigConfiguration related to backtesting.
cancellationTokenCancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
- Task<BacktestScriptApi>
Script API with initialized and running script environment.
Exceptions
- MalfunctionException
Thrown if the initialization of core components fails.
- InvalidProductLicenseException
Thrown if the license provided in the options is invalid.
- FileAccessException
Thrown if it is not possible to create the data folder.
- AlreadyExistsException
Thrown if another instance is already operating on the given data folder.
- OperationCanceledException
Thrown if the operation was cancelled.