AccountingBalanceCheck#
tradeexecutor.strategy.account_correction.AccountingBalanceCheck Python class in Trading Strategy framework.
- class AccountingBalanceCheck[source]#
Bases:
object
Accounting correction applied to a balance.
Any irregular accounting correction will cause the position profit calcualtions and such to become invalid. Such positions should be separately market and not included in the profit calculations.
- __init__(type, holding_address, asset, position, expected_amount, actual_amount, epsilon, block_number, timestamp, usd_value, reserve_asset, mismatch)#
- Parameters:
type (AccountingCorrectionCause) –
holding_address (str) –
asset (AssetIdentifier) –
position (tradeexecutor.state.position.TradingPosition | tradeexecutor.state.reserve.ReservePosition | None) –
expected_amount (Decimal) –
actual_amount (Decimal) –
epsilon (Decimal) –
block_number (int | None) –
timestamp (datetime.datetime | None) –
usd_value (float | None) –
reserve_asset (bool) –
mismatch (bool) –
- Return type:
None
Methods
__init__
(type, holding_address, asset, ...)We have extra
Attributes
How many tokens we corrected
type
Where is this token being stored
Related on-chain asset
Related position
expected_amount
actual_amount
Used epsilon
block_number
timestamp
Keep track of monetary value of corrections.
Is this correction for reserve asset
Was there a balance mismatch that is larger than the epsilon
- asset: AssetIdentifier#
Related on-chain asset
- position: tradeexecutor.state.position.TradingPosition | tradeexecutor.state.reserve.ReservePosition | None#
Related position
Set none if no open position was found
- usd_value: float | None#
Keep track of monetary value of corrections.
An estimated value at the time of the correction creation.
Negative for negative corrections
None if the the tokens are for a new position and we do not have pricing information yet availble.
- property quantity#
How many tokens we corrected
- __init__(type, holding_address, asset, position, expected_amount, actual_amount, epsilon, block_number, timestamp, usd_value, reserve_asset, mismatch)#
- Parameters:
type (AccountingCorrectionCause) –
holding_address (str) –
asset (AssetIdentifier) –
position (tradeexecutor.state.position.TradingPosition | tradeexecutor.state.reserve.ReservePosition | None) –
expected_amount (Decimal) –
actual_amount (Decimal) –
epsilon (Decimal) –
block_number (int | None) –
timestamp (datetime.datetime | None) –
usd_value (float | None) –
reserve_asset (bool) –
mismatch (bool) –
- Return type:
None