Skip to content

API Reference


API Reference / CostModel

Interface: CostModel ​

Defined in: src/backtest/types.ts:144

Methods ​

slippage()? ​

optional slippage(rawPrice, direction, quantity): number

Defined in: src/backtest/types.ts:146

Returns the adjusted fill price (not a delta) for a fill going direction.

Parameters ​

rawPrice ​

number

direction ​

FillDirection

quantity ​

number

Returns ​

number


fees()? ​

optional fees(fillPrice, quantity): number

Defined in: src/backtest/types.ts:148

Charged on both the entry and the exit leg; summed into ClosedTrade.fees.

Parameters ​

fillPrice ​

number

quantity ​

number

Returns ​

number

Community project — not affiliated with Dhan. MIT License.