Skip to content

LocalDiskShortableProvider

QuantConnect.Data.Shortable.LocalDiskShortableProvider

LocalDiskShortableProvider(brokerage: str)

Bases: Object, IShortableProvider

Sources short availability data from the local disk for the given brokerage

Creates an instance of the class. Establishes the directory to read from.

Parameters:

Name Type Description Default
brokerage str

Brokerage to read the short availability data

required

data_provider

data_provider: IDataProvider = ...

The data provider instance to use

This codeEntityType is protected.

brokerage

brokerage: str

The short availability provider

This codeEntityType is protected.

fee_rate

fee_rate(symbol: Symbol, local_time: datetime) -> float

Gets interest rate charged on borrowed shares for a given asset.

Parameters:

Name Type Description Default
symbol Symbol

Symbol to lookup fee rate

required
local_time datetime

Time of the algorithm

required

Returns:

Type Description
float

Fee rate. Zero if the data for the brokerage/date does not exist.

rebate_rate

rebate_rate(symbol: Symbol, local_time: datetime) -> float

Gets the Fed funds or other currency-relevant benchmark rate minus the interest rate charged on borrowed shares for a given asset. E.g.: Interest rate - borrow fee rate = borrow rebate rate: 5.32% - 0.25% = 5.07%.

Parameters:

Name Type Description Default
symbol Symbol

Symbol to lookup rebate rate

required
local_time datetime

Time of the algorithm

required

Returns:

Type Description
float

Rebate fee. Zero if the data for the brokerage/date does not exist.

shortable_quantity

shortable_quantity(
    symbol: Symbol, local_time: datetime
) -> Optional[int]

Gets the quantity shortable for the Symbol at the given date.

Parameters:

Name Type Description Default
symbol Symbol

Symbol to lookup shortable quantity

required
local_time datetime

Time of the algorithm

required

Returns:

Type Description
Optional[int]

Quantity shortable. Null if the data for the brokerage/date does not exist.