Table of Contents

Class BacktestScriptApi

Namespace
WhalesSecret.ScriptApiLib.Backtest
Assembly
WhalesSecret.ScriptApiLib.dll

Trade script API for backtesting.

public class BacktestScriptApi : IScriptApi, IAsyncDisposable
Inheritance
BacktestScriptApi
Implements
Inherited Members
Extension Methods

Remarks

Backtesting is based on real market data downloaded from an exchange. More specifically, 1-minute candles are downloaded for the whole backtesting period. From these candles we create backtest simulation snapshots that are used to simulate the market in backtesting. The snapshots are generated in a way that allows us to simulate the market with arbitrary granularity even though we have only 1-minute candles.

Methods

ConnectAsync(ExchangeMarket, ConnectionOptions?)

Connects to exchangeMarket and does appropriate API initialization to allow fully-fledged trading.

If the logged in WhalesSecret account is already connected to the exchange, the operation succeeds immediately.

If the connection is lost, an automatic reconnect is attempted.

CreateAsync(CreateOptions, BacktestConfig, CancellationToken)

Creates a new instance of the backtest script API.

CreateAsync(BacktestConfig, CancellationToken)

Creates a new instance of the script API with initialized script environment with default create options.

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

DisposeCoreAsync()

Frees managed resources used by the object.

InitializeMarketAsync(ExchangeMarket, CancellationToken)

Initializes the given exchange market.

SetCredentials(IApiIdentity)

Sets credentials for the API. It's only possible to set credentials for each exchange market once.