Skip to content

IBrokerageCashSynchronizer

QuantConnect.Interfaces.IBrokerageCashSynchronizer

Defines live brokerage cash synchronization operations.

last_sync_date_time_utc

last_sync_date_time_utc: datetime

Gets the datetime of the last sync (UTC)

perform_cash_sync

perform_cash_sync(
    algorithm: IAlgorithm,
    current_time_utc: Union[datetime, date],
    get_time_since_last_fill: Callable[[], timedelta],
) -> bool

Synchronizes the cashbook with the brokerage account

Parameters:

Name Type Description Default
algorithm IAlgorithm

The algorithm instance

required
current_time_utc Union[datetime, date]

The current time (UTC)

required
get_time_since_last_fill Callable[[], timedelta]

A function which returns the time elapsed since the last fill

required

Returns:

Type Description
bool

True if the cash sync was performed successfully.

should_perform_cash_sync

should_perform_cash_sync(
    current_time_utc: Union[datetime, date],
) -> bool

Returns whether the brokerage should perform the cash synchronization

Parameters:

Name Type Description Default
current_time_utc Union[datetime, date]

The current time (UTC)

required

Returns:

Type Description
bool

True if the cash sync should be performed.