Function getRemainingCostBasis

  • Returns the remaining cost basis in dollars — how much of the position is still held (not yet closed by partials). Correctly accounts for DCA entries between partial closes.

    Correctly-named alias for getTotalCostClosed.

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise - remaining cost basis in dollars

    import { getRemainingCostBasis } from "backtest-kit";

    const remaining = await getRemainingCostBasis("BTCUSDT");
    console.log(`Holding $${remaining} of position`);