backtest-kit 7.7.0 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.cjs +145 -0
- package/build/index.mjs +145 -1
- package/package.json +1 -1
- package/types.d.ts +74 -1
package/build/index.cjs
CHANGED
|
@@ -3865,6 +3865,27 @@ class ClientExchange {
|
|
|
3865
3865
|
const vwap = sumPriceVolume / totalVolume;
|
|
3866
3866
|
return vwap;
|
|
3867
3867
|
}
|
|
3868
|
+
/**
|
|
3869
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
3870
|
+
*
|
|
3871
|
+
* Fetches a single candle for the requested interval and returns its close price.
|
|
3872
|
+
*
|
|
3873
|
+
* @param symbol - Trading pair symbol
|
|
3874
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
3875
|
+
* @returns Promise resolving to close price of the last candle
|
|
3876
|
+
* @throws Error if no candles available
|
|
3877
|
+
*/
|
|
3878
|
+
async getClosePrice(symbol, interval) {
|
|
3879
|
+
this.params.logger.debug(`ClientExchange getClosePrice`, {
|
|
3880
|
+
symbol,
|
|
3881
|
+
interval,
|
|
3882
|
+
});
|
|
3883
|
+
const candles = await this.getCandles(symbol, interval, 1);
|
|
3884
|
+
if (candles.length === 0) {
|
|
3885
|
+
throw new Error(`ClientExchange getClosePrice: no candles data for symbol=${symbol}`);
|
|
3886
|
+
}
|
|
3887
|
+
return candles[candles.length - 1].close;
|
|
3888
|
+
}
|
|
3868
3889
|
/**
|
|
3869
3890
|
* Formats quantity according to exchange-specific rules for the given symbol.
|
|
3870
3891
|
* Applies proper decimal precision and rounding based on symbol's lot size filters.
|
|
@@ -4270,6 +4291,22 @@ class ExchangeConnectionService {
|
|
|
4270
4291
|
});
|
|
4271
4292
|
return await this.getExchange(this.methodContextService.context.exchangeName).getAveragePrice(symbol);
|
|
4272
4293
|
};
|
|
4294
|
+
/**
|
|
4295
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
4296
|
+
*
|
|
4297
|
+
* Routes to exchange determined by methodContextService.context.exchangeName.
|
|
4298
|
+
*
|
|
4299
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
4300
|
+
* @param interval - Candle interval (e.g., "1h", "1d")
|
|
4301
|
+
* @returns Promise resolving to close price of the last candle
|
|
4302
|
+
*/
|
|
4303
|
+
this.getClosePrice = async (symbol, interval) => {
|
|
4304
|
+
this.loggerService.log("exchangeConnectionService getClosePrice", {
|
|
4305
|
+
symbol,
|
|
4306
|
+
interval,
|
|
4307
|
+
});
|
|
4308
|
+
return await this.getExchange(this.methodContextService.context.exchangeName).getClosePrice(symbol, interval);
|
|
4309
|
+
};
|
|
4273
4310
|
/**
|
|
4274
4311
|
* Formats price according to exchange-specific precision rules.
|
|
4275
4312
|
*
|
|
@@ -14860,6 +14897,34 @@ class ExchangeCoreService {
|
|
|
14860
14897
|
backtest,
|
|
14861
14898
|
});
|
|
14862
14899
|
};
|
|
14900
|
+
/**
|
|
14901
|
+
* Returns the close price of the last completed candle for the given interval with execution context.
|
|
14902
|
+
*
|
|
14903
|
+
* @param symbol - Trading pair symbol
|
|
14904
|
+
* @param interval - Candle interval (e.g., "1m", "1h")
|
|
14905
|
+
* @param when - Timestamp for context (used in backtest mode)
|
|
14906
|
+
* @param backtest - Whether running in backtest mode
|
|
14907
|
+
* @returns Promise resolving to close price of the last candle
|
|
14908
|
+
*/
|
|
14909
|
+
this.getClosePrice = async (symbol, interval, when, backtest) => {
|
|
14910
|
+
this.loggerService.log("exchangeCoreService getClosePrice", {
|
|
14911
|
+
symbol,
|
|
14912
|
+
interval,
|
|
14913
|
+
when,
|
|
14914
|
+
backtest,
|
|
14915
|
+
});
|
|
14916
|
+
if (!MethodContextService.hasContext()) {
|
|
14917
|
+
throw new Error("exchangeCoreService getClosePrice requires a method context");
|
|
14918
|
+
}
|
|
14919
|
+
await this.validate(this.methodContextService.context.exchangeName);
|
|
14920
|
+
return await ExecutionContextService.runInContext(async () => {
|
|
14921
|
+
return await this.exchangeConnectionService.getClosePrice(symbol, interval);
|
|
14922
|
+
}, {
|
|
14923
|
+
symbol,
|
|
14924
|
+
when,
|
|
14925
|
+
backtest,
|
|
14926
|
+
});
|
|
14927
|
+
};
|
|
14863
14928
|
/**
|
|
14864
14929
|
* Formats price with execution context.
|
|
14865
14930
|
*
|
|
@@ -33548,6 +33613,7 @@ async function getBacktestTimeframe(symbol) {
|
|
|
33548
33613
|
|
|
33549
33614
|
const EXCHANGE_METHOD_NAME_GET_CANDLES = "ExchangeUtils.getCandles";
|
|
33550
33615
|
const EXCHANGE_METHOD_NAME_GET_AVERAGE_PRICE = "ExchangeUtils.getAveragePrice";
|
|
33616
|
+
const EXCHANGE_METHOD_NAME_GET_CLOSE_PRICE = "ExchangeUtils.getClosePrice";
|
|
33551
33617
|
const EXCHANGE_METHOD_NAME_FORMAT_QUANTITY = "ExchangeUtils.formatQuantity";
|
|
33552
33618
|
const EXCHANGE_METHOD_NAME_FORMAT_PRICE = "ExchangeUtils.formatPrice";
|
|
33553
33619
|
const EXCHANGE_METHOD_NAME_GET_ORDER_BOOK = "ExchangeUtils.getOrderBook";
|
|
@@ -33905,6 +33971,35 @@ class ExchangeInstance {
|
|
|
33905
33971
|
const vwap = sumPriceVolume / totalVolume;
|
|
33906
33972
|
return vwap;
|
|
33907
33973
|
};
|
|
33974
|
+
/**
|
|
33975
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
33976
|
+
*
|
|
33977
|
+
* Fetches a single candle for the requested interval and returns its close price.
|
|
33978
|
+
*
|
|
33979
|
+
* @param symbol - Trading pair symbol
|
|
33980
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
33981
|
+
* @returns Promise resolving to close price of the last candle
|
|
33982
|
+
* @throws Error if no candles available
|
|
33983
|
+
*
|
|
33984
|
+
* @example
|
|
33985
|
+
* ```typescript
|
|
33986
|
+
* const instance = new ExchangeInstance("binance");
|
|
33987
|
+
* const close = await instance.getClosePrice("BTCUSDT", "1h");
|
|
33988
|
+
* console.log(close); // 50125.43
|
|
33989
|
+
* ```
|
|
33990
|
+
*/
|
|
33991
|
+
this.getClosePrice = async (symbol, interval) => {
|
|
33992
|
+
backtest.loggerService.debug(`ExchangeInstance getClosePrice`, {
|
|
33993
|
+
exchangeName: this.exchangeName,
|
|
33994
|
+
symbol,
|
|
33995
|
+
interval,
|
|
33996
|
+
});
|
|
33997
|
+
const candles = await this.getCandles(symbol, interval, 1);
|
|
33998
|
+
if (candles.length === 0) {
|
|
33999
|
+
throw new Error(`ExchangeInstance getClosePrice: no candles data for symbol=${symbol}`);
|
|
34000
|
+
}
|
|
34001
|
+
return candles[candles.length - 1].close;
|
|
34002
|
+
};
|
|
33908
34003
|
/**
|
|
33909
34004
|
* Format quantity according to exchange precision rules.
|
|
33910
34005
|
*
|
|
@@ -34262,6 +34357,28 @@ class ExchangeUtils {
|
|
|
34262
34357
|
const instance = this._getInstance(context.exchangeName);
|
|
34263
34358
|
return await instance.getAveragePrice(symbol);
|
|
34264
34359
|
};
|
|
34360
|
+
/**
|
|
34361
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
34362
|
+
*
|
|
34363
|
+
* @param symbol - Trading pair symbol
|
|
34364
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
34365
|
+
* @param context - Execution context with exchange name
|
|
34366
|
+
* @returns Promise resolving to close price of the last candle
|
|
34367
|
+
* @throws Error if no candles available
|
|
34368
|
+
*
|
|
34369
|
+
* @example
|
|
34370
|
+
* ```typescript
|
|
34371
|
+
* const close = await Exchange.getClosePrice("BTCUSDT", "1h", {
|
|
34372
|
+
* exchangeName: "binance"
|
|
34373
|
+
* });
|
|
34374
|
+
* console.log(close); // 50125.43
|
|
34375
|
+
* ```
|
|
34376
|
+
*/
|
|
34377
|
+
this.getClosePrice = async (symbol, interval, context) => {
|
|
34378
|
+
backtest.exchangeValidationService.validate(context.exchangeName, EXCHANGE_METHOD_NAME_GET_CLOSE_PRICE);
|
|
34379
|
+
const instance = this._getInstance(context.exchangeName);
|
|
34380
|
+
return await instance.getClosePrice(symbol, interval);
|
|
34381
|
+
};
|
|
34265
34382
|
/**
|
|
34266
34383
|
* Format quantity according to exchange precision rules.
|
|
34267
34384
|
*
|
|
@@ -34848,6 +34965,7 @@ function getActionSchema(actionName) {
|
|
|
34848
34965
|
|
|
34849
34966
|
const GET_CANDLES_METHOD_NAME = "exchange.getCandles";
|
|
34850
34967
|
const GET_AVERAGE_PRICE_METHOD_NAME = "exchange.getAveragePrice";
|
|
34968
|
+
const GET_CLOSE_PRICE_METHOD_NAME = "exchange.getClosePrice";
|
|
34851
34969
|
const FORMAT_PRICE_METHOD_NAME = "exchange.formatPrice";
|
|
34852
34970
|
const FORMAT_QUANTITY_METHOD_NAME = "exchange.formatQuantity";
|
|
34853
34971
|
const GET_DATE_METHOD_NAME = "exchange.getDate";
|
|
@@ -34945,6 +35063,32 @@ async function getAveragePrice(symbol) {
|
|
|
34945
35063
|
}
|
|
34946
35064
|
return await backtest.exchangeConnectionService.getAveragePrice(symbol);
|
|
34947
35065
|
}
|
|
35066
|
+
/**
|
|
35067
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
35068
|
+
*
|
|
35069
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
35070
|
+
* @param interval - Candle interval ("1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h")
|
|
35071
|
+
* @returns Promise resolving to close price of the last candle
|
|
35072
|
+
*
|
|
35073
|
+
* @example
|
|
35074
|
+
* ```typescript
|
|
35075
|
+
* const close = await getClosePrice("BTCUSDT", "1h");
|
|
35076
|
+
* console.log(close); // 50125.43
|
|
35077
|
+
* ```
|
|
35078
|
+
*/
|
|
35079
|
+
async function getClosePrice(symbol, interval) {
|
|
35080
|
+
backtest.loggerService.info(GET_CLOSE_PRICE_METHOD_NAME, {
|
|
35081
|
+
symbol,
|
|
35082
|
+
interval,
|
|
35083
|
+
});
|
|
35084
|
+
if (!ExecutionContextService.hasContext()) {
|
|
35085
|
+
throw new Error("getClosePrice requires an execution context");
|
|
35086
|
+
}
|
|
35087
|
+
if (!MethodContextService.hasContext()) {
|
|
35088
|
+
throw new Error("getClosePrice requires a method context");
|
|
35089
|
+
}
|
|
35090
|
+
return await backtest.exchangeConnectionService.getClosePrice(symbol, interval);
|
|
35091
|
+
}
|
|
34948
35092
|
/**
|
|
34949
35093
|
* Formats a price value according to exchange rules.
|
|
34950
35094
|
*
|
|
@@ -61690,6 +61834,7 @@ exports.getAveragePrice = getAveragePrice;
|
|
|
61690
61834
|
exports.getBacktestTimeframe = getBacktestTimeframe;
|
|
61691
61835
|
exports.getBreakeven = getBreakeven;
|
|
61692
61836
|
exports.getCandles = getCandles;
|
|
61837
|
+
exports.getClosePrice = getClosePrice;
|
|
61693
61838
|
exports.getColumns = getColumns;
|
|
61694
61839
|
exports.getConfig = getConfig;
|
|
61695
61840
|
exports.getContext = getContext;
|
package/build/index.mjs
CHANGED
|
@@ -3845,6 +3845,27 @@ class ClientExchange {
|
|
|
3845
3845
|
const vwap = sumPriceVolume / totalVolume;
|
|
3846
3846
|
return vwap;
|
|
3847
3847
|
}
|
|
3848
|
+
/**
|
|
3849
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
3850
|
+
*
|
|
3851
|
+
* Fetches a single candle for the requested interval and returns its close price.
|
|
3852
|
+
*
|
|
3853
|
+
* @param symbol - Trading pair symbol
|
|
3854
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
3855
|
+
* @returns Promise resolving to close price of the last candle
|
|
3856
|
+
* @throws Error if no candles available
|
|
3857
|
+
*/
|
|
3858
|
+
async getClosePrice(symbol, interval) {
|
|
3859
|
+
this.params.logger.debug(`ClientExchange getClosePrice`, {
|
|
3860
|
+
symbol,
|
|
3861
|
+
interval,
|
|
3862
|
+
});
|
|
3863
|
+
const candles = await this.getCandles(symbol, interval, 1);
|
|
3864
|
+
if (candles.length === 0) {
|
|
3865
|
+
throw new Error(`ClientExchange getClosePrice: no candles data for symbol=${symbol}`);
|
|
3866
|
+
}
|
|
3867
|
+
return candles[candles.length - 1].close;
|
|
3868
|
+
}
|
|
3848
3869
|
/**
|
|
3849
3870
|
* Formats quantity according to exchange-specific rules for the given symbol.
|
|
3850
3871
|
* Applies proper decimal precision and rounding based on symbol's lot size filters.
|
|
@@ -4250,6 +4271,22 @@ class ExchangeConnectionService {
|
|
|
4250
4271
|
});
|
|
4251
4272
|
return await this.getExchange(this.methodContextService.context.exchangeName).getAveragePrice(symbol);
|
|
4252
4273
|
};
|
|
4274
|
+
/**
|
|
4275
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
4276
|
+
*
|
|
4277
|
+
* Routes to exchange determined by methodContextService.context.exchangeName.
|
|
4278
|
+
*
|
|
4279
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
4280
|
+
* @param interval - Candle interval (e.g., "1h", "1d")
|
|
4281
|
+
* @returns Promise resolving to close price of the last candle
|
|
4282
|
+
*/
|
|
4283
|
+
this.getClosePrice = async (symbol, interval) => {
|
|
4284
|
+
this.loggerService.log("exchangeConnectionService getClosePrice", {
|
|
4285
|
+
symbol,
|
|
4286
|
+
interval,
|
|
4287
|
+
});
|
|
4288
|
+
return await this.getExchange(this.methodContextService.context.exchangeName).getClosePrice(symbol, interval);
|
|
4289
|
+
};
|
|
4253
4290
|
/**
|
|
4254
4291
|
* Formats price according to exchange-specific precision rules.
|
|
4255
4292
|
*
|
|
@@ -14840,6 +14877,34 @@ class ExchangeCoreService {
|
|
|
14840
14877
|
backtest,
|
|
14841
14878
|
});
|
|
14842
14879
|
};
|
|
14880
|
+
/**
|
|
14881
|
+
* Returns the close price of the last completed candle for the given interval with execution context.
|
|
14882
|
+
*
|
|
14883
|
+
* @param symbol - Trading pair symbol
|
|
14884
|
+
* @param interval - Candle interval (e.g., "1m", "1h")
|
|
14885
|
+
* @param when - Timestamp for context (used in backtest mode)
|
|
14886
|
+
* @param backtest - Whether running in backtest mode
|
|
14887
|
+
* @returns Promise resolving to close price of the last candle
|
|
14888
|
+
*/
|
|
14889
|
+
this.getClosePrice = async (symbol, interval, when, backtest) => {
|
|
14890
|
+
this.loggerService.log("exchangeCoreService getClosePrice", {
|
|
14891
|
+
symbol,
|
|
14892
|
+
interval,
|
|
14893
|
+
when,
|
|
14894
|
+
backtest,
|
|
14895
|
+
});
|
|
14896
|
+
if (!MethodContextService.hasContext()) {
|
|
14897
|
+
throw new Error("exchangeCoreService getClosePrice requires a method context");
|
|
14898
|
+
}
|
|
14899
|
+
await this.validate(this.methodContextService.context.exchangeName);
|
|
14900
|
+
return await ExecutionContextService.runInContext(async () => {
|
|
14901
|
+
return await this.exchangeConnectionService.getClosePrice(symbol, interval);
|
|
14902
|
+
}, {
|
|
14903
|
+
symbol,
|
|
14904
|
+
when,
|
|
14905
|
+
backtest,
|
|
14906
|
+
});
|
|
14907
|
+
};
|
|
14843
14908
|
/**
|
|
14844
14909
|
* Formats price with execution context.
|
|
14845
14910
|
*
|
|
@@ -33528,6 +33593,7 @@ async function getBacktestTimeframe(symbol) {
|
|
|
33528
33593
|
|
|
33529
33594
|
const EXCHANGE_METHOD_NAME_GET_CANDLES = "ExchangeUtils.getCandles";
|
|
33530
33595
|
const EXCHANGE_METHOD_NAME_GET_AVERAGE_PRICE = "ExchangeUtils.getAveragePrice";
|
|
33596
|
+
const EXCHANGE_METHOD_NAME_GET_CLOSE_PRICE = "ExchangeUtils.getClosePrice";
|
|
33531
33597
|
const EXCHANGE_METHOD_NAME_FORMAT_QUANTITY = "ExchangeUtils.formatQuantity";
|
|
33532
33598
|
const EXCHANGE_METHOD_NAME_FORMAT_PRICE = "ExchangeUtils.formatPrice";
|
|
33533
33599
|
const EXCHANGE_METHOD_NAME_GET_ORDER_BOOK = "ExchangeUtils.getOrderBook";
|
|
@@ -33885,6 +33951,35 @@ class ExchangeInstance {
|
|
|
33885
33951
|
const vwap = sumPriceVolume / totalVolume;
|
|
33886
33952
|
return vwap;
|
|
33887
33953
|
};
|
|
33954
|
+
/**
|
|
33955
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
33956
|
+
*
|
|
33957
|
+
* Fetches a single candle for the requested interval and returns its close price.
|
|
33958
|
+
*
|
|
33959
|
+
* @param symbol - Trading pair symbol
|
|
33960
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
33961
|
+
* @returns Promise resolving to close price of the last candle
|
|
33962
|
+
* @throws Error if no candles available
|
|
33963
|
+
*
|
|
33964
|
+
* @example
|
|
33965
|
+
* ```typescript
|
|
33966
|
+
* const instance = new ExchangeInstance("binance");
|
|
33967
|
+
* const close = await instance.getClosePrice("BTCUSDT", "1h");
|
|
33968
|
+
* console.log(close); // 50125.43
|
|
33969
|
+
* ```
|
|
33970
|
+
*/
|
|
33971
|
+
this.getClosePrice = async (symbol, interval) => {
|
|
33972
|
+
backtest.loggerService.debug(`ExchangeInstance getClosePrice`, {
|
|
33973
|
+
exchangeName: this.exchangeName,
|
|
33974
|
+
symbol,
|
|
33975
|
+
interval,
|
|
33976
|
+
});
|
|
33977
|
+
const candles = await this.getCandles(symbol, interval, 1);
|
|
33978
|
+
if (candles.length === 0) {
|
|
33979
|
+
throw new Error(`ExchangeInstance getClosePrice: no candles data for symbol=${symbol}`);
|
|
33980
|
+
}
|
|
33981
|
+
return candles[candles.length - 1].close;
|
|
33982
|
+
};
|
|
33888
33983
|
/**
|
|
33889
33984
|
* Format quantity according to exchange precision rules.
|
|
33890
33985
|
*
|
|
@@ -34242,6 +34337,28 @@ class ExchangeUtils {
|
|
|
34242
34337
|
const instance = this._getInstance(context.exchangeName);
|
|
34243
34338
|
return await instance.getAveragePrice(symbol);
|
|
34244
34339
|
};
|
|
34340
|
+
/**
|
|
34341
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
34342
|
+
*
|
|
34343
|
+
* @param symbol - Trading pair symbol
|
|
34344
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
34345
|
+
* @param context - Execution context with exchange name
|
|
34346
|
+
* @returns Promise resolving to close price of the last candle
|
|
34347
|
+
* @throws Error if no candles available
|
|
34348
|
+
*
|
|
34349
|
+
* @example
|
|
34350
|
+
* ```typescript
|
|
34351
|
+
* const close = await Exchange.getClosePrice("BTCUSDT", "1h", {
|
|
34352
|
+
* exchangeName: "binance"
|
|
34353
|
+
* });
|
|
34354
|
+
* console.log(close); // 50125.43
|
|
34355
|
+
* ```
|
|
34356
|
+
*/
|
|
34357
|
+
this.getClosePrice = async (symbol, interval, context) => {
|
|
34358
|
+
backtest.exchangeValidationService.validate(context.exchangeName, EXCHANGE_METHOD_NAME_GET_CLOSE_PRICE);
|
|
34359
|
+
const instance = this._getInstance(context.exchangeName);
|
|
34360
|
+
return await instance.getClosePrice(symbol, interval);
|
|
34361
|
+
};
|
|
34245
34362
|
/**
|
|
34246
34363
|
* Format quantity according to exchange precision rules.
|
|
34247
34364
|
*
|
|
@@ -34828,6 +34945,7 @@ function getActionSchema(actionName) {
|
|
|
34828
34945
|
|
|
34829
34946
|
const GET_CANDLES_METHOD_NAME = "exchange.getCandles";
|
|
34830
34947
|
const GET_AVERAGE_PRICE_METHOD_NAME = "exchange.getAveragePrice";
|
|
34948
|
+
const GET_CLOSE_PRICE_METHOD_NAME = "exchange.getClosePrice";
|
|
34831
34949
|
const FORMAT_PRICE_METHOD_NAME = "exchange.formatPrice";
|
|
34832
34950
|
const FORMAT_QUANTITY_METHOD_NAME = "exchange.formatQuantity";
|
|
34833
34951
|
const GET_DATE_METHOD_NAME = "exchange.getDate";
|
|
@@ -34925,6 +35043,32 @@ async function getAveragePrice(symbol) {
|
|
|
34925
35043
|
}
|
|
34926
35044
|
return await backtest.exchangeConnectionService.getAveragePrice(symbol);
|
|
34927
35045
|
}
|
|
35046
|
+
/**
|
|
35047
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
35048
|
+
*
|
|
35049
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
35050
|
+
* @param interval - Candle interval ("1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h")
|
|
35051
|
+
* @returns Promise resolving to close price of the last candle
|
|
35052
|
+
*
|
|
35053
|
+
* @example
|
|
35054
|
+
* ```typescript
|
|
35055
|
+
* const close = await getClosePrice("BTCUSDT", "1h");
|
|
35056
|
+
* console.log(close); // 50125.43
|
|
35057
|
+
* ```
|
|
35058
|
+
*/
|
|
35059
|
+
async function getClosePrice(symbol, interval) {
|
|
35060
|
+
backtest.loggerService.info(GET_CLOSE_PRICE_METHOD_NAME, {
|
|
35061
|
+
symbol,
|
|
35062
|
+
interval,
|
|
35063
|
+
});
|
|
35064
|
+
if (!ExecutionContextService.hasContext()) {
|
|
35065
|
+
throw new Error("getClosePrice requires an execution context");
|
|
35066
|
+
}
|
|
35067
|
+
if (!MethodContextService.hasContext()) {
|
|
35068
|
+
throw new Error("getClosePrice requires a method context");
|
|
35069
|
+
}
|
|
35070
|
+
return await backtest.exchangeConnectionService.getClosePrice(symbol, interval);
|
|
35071
|
+
}
|
|
34928
35072
|
/**
|
|
34929
35073
|
* Formats a price value according to exchange rules.
|
|
34930
35074
|
*
|
|
@@ -61557,4 +61701,4 @@ const validateSignal = (signal, currentPrice) => {
|
|
|
61557
61701
|
return !errors.length;
|
|
61558
61702
|
};
|
|
61559
61703
|
|
|
61560
|
-
export { ActionBase, Backtest, Breakeven, Broker, BrokerBase, Cache, Constant, Dump, Exchange, ExecutionContextService, Heat, HighestProfit, Interval, Live, Log, Markdown, MarkdownFileBase, MarkdownFolderBase, MarkdownWriter, MaxDrawdown, Memory, MemoryBacktest, MemoryBacktestAdapter, MemoryLive, MemoryLiveAdapter, MethodContextService, Notification, NotificationBacktest, NotificationLive, Partial, Performance, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistIntervalAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRecentAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSessionAdapter, PersistSignalAdapter, PersistStateAdapter, PersistStorageAdapter, Position, PositionSize, Recent, RecentBacktest, RecentLive, Reflect$1 as Reflect, Report, ReportBase, ReportWriter, Risk, Schedule, Session, SessionBacktest, SessionLive, State, StateBacktest, StateBacktestAdapter, StateLive, StateLiveAdapter, Storage, StorageBacktest, StorageLive, Strategy, Sync, System, Walker, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitSignalNotify, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, createSignalState, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getLatestSignal, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMinutesSinceLatestSignalCreated, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionActiveMinutes, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestMaxDrawdownPnlCost, getPositionHighestMaxDrawdownPnlPercentage, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitDistancePnlCost, getPositionHighestProfitDistancePnlPercentage, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getPositionWaitingMinutes, getRawCandles, getRiskSchema, getScheduledSignal, getSessionData, getSignalState, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenIdlePing, listenIdlePingOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalNotify, listenSignalNotifyOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, runInMockContext, searchMemory, set, setColumns, setConfig, setLogger, setSessionData, setSignalState, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
|
|
61704
|
+
export { ActionBase, Backtest, Breakeven, Broker, BrokerBase, Cache, Constant, Dump, Exchange, ExecutionContextService, Heat, HighestProfit, Interval, Live, Log, Markdown, MarkdownFileBase, MarkdownFolderBase, MarkdownWriter, MaxDrawdown, Memory, MemoryBacktest, MemoryBacktestAdapter, MemoryLive, MemoryLiveAdapter, MethodContextService, Notification, NotificationBacktest, NotificationLive, Partial, Performance, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistIntervalAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRecentAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSessionAdapter, PersistSignalAdapter, PersistStateAdapter, PersistStorageAdapter, Position, PositionSize, Recent, RecentBacktest, RecentLive, Reflect$1 as Reflect, Report, ReportBase, ReportWriter, Risk, Schedule, Session, SessionBacktest, SessionLive, State, StateBacktest, StateBacktestAdapter, StateLive, StateLiveAdapter, Storage, StorageBacktest, StorageLive, Strategy, Sync, System, Walker, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitSignalNotify, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, createSignalState, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getClosePrice, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getLatestSignal, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMinutesSinceLatestSignalCreated, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionActiveMinutes, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestMaxDrawdownPnlCost, getPositionHighestMaxDrawdownPnlPercentage, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitDistancePnlCost, getPositionHighestProfitDistancePnlPercentage, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getPositionWaitingMinutes, getRawCandles, getRiskSchema, getScheduledSignal, getSessionData, getSignalState, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenIdlePing, listenIdlePingOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalNotify, listenSignalNotifyOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, runInMockContext, searchMemory, set, setColumns, setConfig, setLogger, setSessionData, setSignalState, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -4210,6 +4210,14 @@ interface IExchange {
|
|
|
4210
4210
|
* @returns Promise resolving to volume-weighted average price
|
|
4211
4211
|
*/
|
|
4212
4212
|
getAveragePrice: (symbol: string) => Promise<number>;
|
|
4213
|
+
/**
|
|
4214
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
4215
|
+
*
|
|
4216
|
+
* @param symbol - Trading pair symbol
|
|
4217
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
4218
|
+
* @returns Promise resolving to close price of the last candle
|
|
4219
|
+
*/
|
|
4220
|
+
getClosePrice: (symbol: string, interval: CandleInterval) => Promise<number>;
|
|
4213
4221
|
/**
|
|
4214
4222
|
* Fetch order book for a trading pair.
|
|
4215
4223
|
*
|
|
@@ -9094,6 +9102,20 @@ declare function getCandles(symbol: string, interval: CandleInterval, limit: num
|
|
|
9094
9102
|
* ```
|
|
9095
9103
|
*/
|
|
9096
9104
|
declare function getAveragePrice(symbol: string): Promise<number>;
|
|
9105
|
+
/**
|
|
9106
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
9107
|
+
*
|
|
9108
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
9109
|
+
* @param interval - Candle interval ("1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h")
|
|
9110
|
+
* @returns Promise resolving to close price of the last candle
|
|
9111
|
+
*
|
|
9112
|
+
* @example
|
|
9113
|
+
* ```typescript
|
|
9114
|
+
* const close = await getClosePrice("BTCUSDT", "1h");
|
|
9115
|
+
* console.log(close); // 50125.43
|
|
9116
|
+
* ```
|
|
9117
|
+
*/
|
|
9118
|
+
declare function getClosePrice(symbol: string, interval: CandleInterval): Promise<number>;
|
|
9097
9119
|
/**
|
|
9098
9120
|
* Formats a price value according to exchange rules.
|
|
9099
9121
|
*
|
|
@@ -23463,6 +23485,26 @@ declare class ExchangeUtils {
|
|
|
23463
23485
|
getAveragePrice: (symbol: string, context: {
|
|
23464
23486
|
exchangeName: ExchangeName;
|
|
23465
23487
|
}) => Promise<number>;
|
|
23488
|
+
/**
|
|
23489
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
23490
|
+
*
|
|
23491
|
+
* @param symbol - Trading pair symbol
|
|
23492
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
23493
|
+
* @param context - Execution context with exchange name
|
|
23494
|
+
* @returns Promise resolving to close price of the last candle
|
|
23495
|
+
* @throws Error if no candles available
|
|
23496
|
+
*
|
|
23497
|
+
* @example
|
|
23498
|
+
* ```typescript
|
|
23499
|
+
* const close = await Exchange.getClosePrice("BTCUSDT", "1h", {
|
|
23500
|
+
* exchangeName: "binance"
|
|
23501
|
+
* });
|
|
23502
|
+
* console.log(close); // 50125.43
|
|
23503
|
+
* ```
|
|
23504
|
+
*/
|
|
23505
|
+
getClosePrice: (symbol: string, interval: CandleInterval, context: {
|
|
23506
|
+
exchangeName: ExchangeName;
|
|
23507
|
+
}) => Promise<number>;
|
|
23466
23508
|
/**
|
|
23467
23509
|
* Format quantity according to exchange precision rules.
|
|
23468
23510
|
*
|
|
@@ -26854,6 +26896,17 @@ declare class ClientExchange implements IExchange {
|
|
|
26854
26896
|
* @throws Error if no candles available
|
|
26855
26897
|
*/
|
|
26856
26898
|
getAveragePrice(symbol: string): Promise<number>;
|
|
26899
|
+
/**
|
|
26900
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
26901
|
+
*
|
|
26902
|
+
* Fetches a single candle for the requested interval and returns its close price.
|
|
26903
|
+
*
|
|
26904
|
+
* @param symbol - Trading pair symbol
|
|
26905
|
+
* @param interval - Candle time interval (e.g., "1m", "1h")
|
|
26906
|
+
* @returns Promise resolving to close price of the last candle
|
|
26907
|
+
* @throws Error if no candles available
|
|
26908
|
+
*/
|
|
26909
|
+
getClosePrice(symbol: string, interval: CandleInterval): Promise<number>;
|
|
26857
26910
|
/**
|
|
26858
26911
|
* Formats quantity according to exchange-specific rules for the given symbol.
|
|
26859
26912
|
* Applies proper decimal precision and rounding based on symbol's lot size filters.
|
|
@@ -27008,6 +27061,16 @@ declare class ExchangeConnectionService implements IExchange {
|
|
|
27008
27061
|
* @returns Promise resolving to average price
|
|
27009
27062
|
*/
|
|
27010
27063
|
getAveragePrice: (symbol: string) => Promise<number>;
|
|
27064
|
+
/**
|
|
27065
|
+
* Returns the close price of the last completed candle for the given interval.
|
|
27066
|
+
*
|
|
27067
|
+
* Routes to exchange determined by methodContextService.context.exchangeName.
|
|
27068
|
+
*
|
|
27069
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
27070
|
+
* @param interval - Candle interval (e.g., "1h", "1d")
|
|
27071
|
+
* @returns Promise resolving to close price of the last candle
|
|
27072
|
+
*/
|
|
27073
|
+
getClosePrice: (symbol: string, interval: CandleInterval) => Promise<number>;
|
|
27011
27074
|
/**
|
|
27012
27075
|
* Formats price according to exchange-specific precision rules.
|
|
27013
27076
|
*
|
|
@@ -30045,6 +30108,16 @@ declare class ExchangeCoreService implements TExchange {
|
|
|
30045
30108
|
* @returns Promise resolving to VWAP price
|
|
30046
30109
|
*/
|
|
30047
30110
|
getAveragePrice: (symbol: string, when: Date, backtest: boolean) => Promise<number>;
|
|
30111
|
+
/**
|
|
30112
|
+
* Returns the close price of the last completed candle for the given interval with execution context.
|
|
30113
|
+
*
|
|
30114
|
+
* @param symbol - Trading pair symbol
|
|
30115
|
+
* @param interval - Candle interval (e.g., "1m", "1h")
|
|
30116
|
+
* @param when - Timestamp for context (used in backtest mode)
|
|
30117
|
+
* @param backtest - Whether running in backtest mode
|
|
30118
|
+
* @returns Promise resolving to close price of the last candle
|
|
30119
|
+
*/
|
|
30120
|
+
getClosePrice: (symbol: string, interval: CandleInterval, when: Date, backtest: boolean) => Promise<number>;
|
|
30048
30121
|
/**
|
|
30049
30122
|
* Formats price with execution context.
|
|
30050
30123
|
*
|
|
@@ -34048,4 +34121,4 @@ declare const getTotalClosed: (signal: Signal) => {
|
|
|
34048
34121
|
remainingCostBasis: number;
|
|
34049
34122
|
};
|
|
34050
34123
|
|
|
34051
|
-
export { ActionBase, type ActivateScheduledCommit, type ActivateScheduledCommitNotification, type ActivePingContract, type AverageBuyCommit, type AverageBuyCommitNotification, Backtest, type BacktestStatisticsModel, Breakeven, type BreakevenAvailableNotification, type BreakevenCommit, type BreakevenCommitNotification, type BreakevenContract, type BreakevenData, type BreakevenEvent, type BreakevenStatisticsModel, Broker, type BrokerAverageBuyPayload, BrokerBase, type BrokerBreakevenPayload, type BrokerPartialLossPayload, type BrokerPartialProfitPayload, type BrokerSignalClosePayload, type BrokerSignalOpenPayload, type BrokerTrailingStopPayload, type BrokerTrailingTakePayload, Cache, type CancelScheduledCommit, type CancelScheduledCommitNotification, type CandleData, type CandleInterval, type ClosePendingCommit, type ClosePendingCommitNotification, type ColumnConfig, type ColumnModel, type CommitPayload, Constant, type CriticalErrorNotification, type DoneContract, Dump, type EntityId, Exchange, ExecutionContextService, type FrameInterval, type GlobalConfig, Heat, type HeatmapStatisticsModel, HighestProfit, type HighestProfitContract, type HighestProfitEvent, type HighestProfitStatisticsModel, type IActionSchema, type IActivateScheduledCommitRow, type IAggregatedTradeData, type IBidData, type IBreakevenCommitRow, type IBroker, type ICandleData, type ICommitRow, type IDumpContext, type IDumpInstance, type IExchangeSchema, type IFrameSchema, type IHeatmapRow, type ILog, type ILogEntry, type ILogger, type IMarkdownDumpOptions, type IMemoryInstance, type INotificationUtils, type IOrderBookData, type IPartialLossCommitRow, type IPartialProfitCommitRow, type IPersistBase, type IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicAction, type IPublicCandleData, type IPublicSignalRow, type IRecentUtils, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskSignalRow, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISessionInstance, type ISignalDto, type ISignalIntervalDto, type ISignalRow, type ISizingCalculateParams, type ISizingCalculateParamsATR, type ISizingCalculateParamsFixedPercentage, type ISizingCalculateParamsKelly, type ISizingParams, type ISizingParamsATR, type ISizingParamsFixedPercentage, type ISizingParamsKelly, type ISizingSchema, type ISizingSchemaATR, type ISizingSchemaFixedPercentage, type ISizingSchemaKelly, type IStateInstance, type IStorageSignalRow, type IStorageUtils, type IStrategyPnL, type IStrategyResult, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultCancelled, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, type IStrategyTickResultScheduled, type IStrategyTickResultWaiting, type ITrailingStopCommitRow, type ITrailingTakeCommitRow, type IWalkerResults, type IWalkerSchema, type IWalkerStrategyResult, type IdlePingContract, type InfoErrorNotification, Interval, type IntervalData, Live, type LiveStatisticsModel, Log, type LogData, Markdown, MarkdownFileBase, MarkdownFolderBase, type MarkdownName, MarkdownWriter, MaxDrawdown, type MaxDrawdownContract, type MaxDrawdownEvent, type MaxDrawdownStatisticsModel, type MeasureData, Memory, MemoryBacktest, MemoryBacktestAdapter, type MemoryData, MemoryLive, MemoryLiveAdapter, type MessageModel, type MessageRole, type MessageToolCall, MethodContextService, type MetricStats, Notification, NotificationBacktest, type NotificationData, NotificationLive, type NotificationModel, Partial$1 as Partial, type PartialData, type PartialEvent, type PartialLossAvailableNotification, type PartialLossCommit, type PartialLossCommitNotification, type PartialLossContract, type PartialProfitAvailableNotification, type PartialProfitCommit, type PartialProfitCommitNotification, type PartialProfitContract, type PartialStatisticsModel, Performance, type PerformanceContract, type PerformanceMetricType, type PerformanceStatisticsModel, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistIntervalAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRecentAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSessionAdapter, PersistSignalAdapter, PersistStateAdapter, PersistStorageAdapter, Position, PositionSize, type ProgressBacktestContract, type ProgressWalkerContract, Recent, RecentBacktest, type RecentData, RecentLive, Reflect, Report, ReportBase, type ReportName, ReportWriter, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type SchedulePingContract, type ScheduleStatisticsModel, type ScheduledEvent, Session, SessionBacktest, type SessionData, SessionLive, type SignalCancelledNotification, type SignalCloseContract, type SignalClosedNotification, type SignalData, type SignalInfoContract, type SignalInfoNotification, type SignalInterval, type SignalOpenContract, type SignalOpenedNotification, type SignalScheduledNotification, type SignalSyncCloseNotification, type SignalSyncContract, type SignalSyncOpenNotification, State, StateBacktest, StateBacktestAdapter, type StateData, StateLive, StateLiveAdapter, Storage, StorageBacktest, type StorageData, StorageLive, Strategy, type StrategyActionType, type StrategyCancelReason, type StrategyCloseReason, type StrategyCommitContract, type StrategyEvent, type StrategyStatisticsModel, Sync, type SyncEvent, type SyncStatisticsModel, System, type TBrokerCtor, type TDumpInstanceCtor, type TLogCtor, type TMarkdownBase, type TMemoryInstanceCtor, type TNotificationUtilsCtor, type TPersistBase, type TPersistBaseCtor, type TRecentUtilsCtor, type TReportBase, type TSessionInstanceCtor, type TStateInstanceCtor, type TStorageUtilsCtor, type TickEvent, type TrailingStopCommit, type TrailingStopCommitNotification, type TrailingTakeCommit, type TrailingTakeCommitNotification, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitSignalNotify, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, createSignalState, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getLatestSignal, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMinutesSinceLatestSignalCreated, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionActiveMinutes, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestMaxDrawdownPnlCost, getPositionHighestMaxDrawdownPnlPercentage, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitDistancePnlCost, getPositionHighestProfitDistancePnlPercentage, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getPositionWaitingMinutes, getRawCandles, getRiskSchema, getScheduledSignal, getSessionData, getSignalState, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenIdlePing, listenIdlePingOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalNotify, listenSignalNotifyOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, runInMockContext, searchMemory, set, setColumns, setConfig, setLogger, setSessionData, setSignalState, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
|
|
34124
|
+
export { ActionBase, type ActivateScheduledCommit, type ActivateScheduledCommitNotification, type ActivePingContract, type AverageBuyCommit, type AverageBuyCommitNotification, Backtest, type BacktestStatisticsModel, Breakeven, type BreakevenAvailableNotification, type BreakevenCommit, type BreakevenCommitNotification, type BreakevenContract, type BreakevenData, type BreakevenEvent, type BreakevenStatisticsModel, Broker, type BrokerAverageBuyPayload, BrokerBase, type BrokerBreakevenPayload, type BrokerPartialLossPayload, type BrokerPartialProfitPayload, type BrokerSignalClosePayload, type BrokerSignalOpenPayload, type BrokerTrailingStopPayload, type BrokerTrailingTakePayload, Cache, type CancelScheduledCommit, type CancelScheduledCommitNotification, type CandleData, type CandleInterval, type ClosePendingCommit, type ClosePendingCommitNotification, type ColumnConfig, type ColumnModel, type CommitPayload, Constant, type CriticalErrorNotification, type DoneContract, Dump, type EntityId, Exchange, ExecutionContextService, type FrameInterval, type GlobalConfig, Heat, type HeatmapStatisticsModel, HighestProfit, type HighestProfitContract, type HighestProfitEvent, type HighestProfitStatisticsModel, type IActionSchema, type IActivateScheduledCommitRow, type IAggregatedTradeData, type IBidData, type IBreakevenCommitRow, type IBroker, type ICandleData, type ICommitRow, type IDumpContext, type IDumpInstance, type IExchangeSchema, type IFrameSchema, type IHeatmapRow, type ILog, type ILogEntry, type ILogger, type IMarkdownDumpOptions, type IMemoryInstance, type INotificationUtils, type IOrderBookData, type IPartialLossCommitRow, type IPartialProfitCommitRow, type IPersistBase, type IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicAction, type IPublicCandleData, type IPublicSignalRow, type IRecentUtils, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskSignalRow, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISessionInstance, type ISignalDto, type ISignalIntervalDto, type ISignalRow, type ISizingCalculateParams, type ISizingCalculateParamsATR, type ISizingCalculateParamsFixedPercentage, type ISizingCalculateParamsKelly, type ISizingParams, type ISizingParamsATR, type ISizingParamsFixedPercentage, type ISizingParamsKelly, type ISizingSchema, type ISizingSchemaATR, type ISizingSchemaFixedPercentage, type ISizingSchemaKelly, type IStateInstance, type IStorageSignalRow, type IStorageUtils, type IStrategyPnL, type IStrategyResult, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultCancelled, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, type IStrategyTickResultScheduled, type IStrategyTickResultWaiting, type ITrailingStopCommitRow, type ITrailingTakeCommitRow, type IWalkerResults, type IWalkerSchema, type IWalkerStrategyResult, type IdlePingContract, type InfoErrorNotification, Interval, type IntervalData, Live, type LiveStatisticsModel, Log, type LogData, Markdown, MarkdownFileBase, MarkdownFolderBase, type MarkdownName, MarkdownWriter, MaxDrawdown, type MaxDrawdownContract, type MaxDrawdownEvent, type MaxDrawdownStatisticsModel, type MeasureData, Memory, MemoryBacktest, MemoryBacktestAdapter, type MemoryData, MemoryLive, MemoryLiveAdapter, type MessageModel, type MessageRole, type MessageToolCall, MethodContextService, type MetricStats, Notification, NotificationBacktest, type NotificationData, NotificationLive, type NotificationModel, Partial$1 as Partial, type PartialData, type PartialEvent, type PartialLossAvailableNotification, type PartialLossCommit, type PartialLossCommitNotification, type PartialLossContract, type PartialProfitAvailableNotification, type PartialProfitCommit, type PartialProfitCommitNotification, type PartialProfitContract, type PartialStatisticsModel, Performance, type PerformanceContract, type PerformanceMetricType, type PerformanceStatisticsModel, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistIntervalAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRecentAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSessionAdapter, PersistSignalAdapter, PersistStateAdapter, PersistStorageAdapter, Position, PositionSize, type ProgressBacktestContract, type ProgressWalkerContract, Recent, RecentBacktest, type RecentData, RecentLive, Reflect, Report, ReportBase, type ReportName, ReportWriter, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type SchedulePingContract, type ScheduleStatisticsModel, type ScheduledEvent, Session, SessionBacktest, type SessionData, SessionLive, type SignalCancelledNotification, type SignalCloseContract, type SignalClosedNotification, type SignalData, type SignalInfoContract, type SignalInfoNotification, type SignalInterval, type SignalOpenContract, type SignalOpenedNotification, type SignalScheduledNotification, type SignalSyncCloseNotification, type SignalSyncContract, type SignalSyncOpenNotification, State, StateBacktest, StateBacktestAdapter, type StateData, StateLive, StateLiveAdapter, Storage, StorageBacktest, type StorageData, StorageLive, Strategy, type StrategyActionType, type StrategyCancelReason, type StrategyCloseReason, type StrategyCommitContract, type StrategyEvent, type StrategyStatisticsModel, Sync, type SyncEvent, type SyncStatisticsModel, System, type TBrokerCtor, type TDumpInstanceCtor, type TLogCtor, type TMarkdownBase, type TMemoryInstanceCtor, type TNotificationUtilsCtor, type TPersistBase, type TPersistBaseCtor, type TRecentUtilsCtor, type TReportBase, type TSessionInstanceCtor, type TStateInstanceCtor, type TStorageUtilsCtor, type TickEvent, type TrailingStopCommit, type TrailingStopCommitNotification, type TrailingTakeCommit, type TrailingTakeCommitNotification, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitSignalNotify, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, createSignalState, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getClosePrice, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getLatestSignal, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMinutesSinceLatestSignalCreated, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionActiveMinutes, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestMaxDrawdownPnlCost, getPositionHighestMaxDrawdownPnlPercentage, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitDistancePnlCost, getPositionHighestProfitDistancePnlPercentage, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getPositionWaitingMinutes, getRawCandles, getRiskSchema, getScheduledSignal, getSessionData, getSignalState, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenIdlePing, listenIdlePingOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalNotify, listenSignalNotifyOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, runInMockContext, searchMemory, set, setColumns, setConfig, setLogger, setSessionData, setSignalState, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
|