[Home](./index.md) > [bitburner](./bitburner.md) > [Stock](./bitburner.stock.md) > [getPurchaseCost](./bitburner.stock.getpurchasecost.md) ## Stock.getPurchaseCost() method Calculates cost of buying stocks. **Signature:** ```typescript getPurchaseCost(sym: string, shares: number, positionType: PositionType): number; ``` ## Parameters
Parameter Type Description
sym string Stock symbol.
shares number Number of shares to purchase.
positionType [PositionType](./bitburner.positiontype.md) Specifies whether the order is a Long ("L") or Short ("S") position.
**Returns:** number Cost to buy a given number of shares of a stock. ## Remarks RAM cost: 2 GB Calculates and returns how much it would cost to buy a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.