position¶
- class whispertrades.position.Position(data: PositionResponse, client: WTClient, auto_refresh: bool)[source]¶
Bases:
object- auto_refresh : bool¶
auto_refresh toggle inherited from WTClient
- broker_connection : BaseBrokerConnection¶
Broker connection
- broker_fee : float | None¶
Broker fee
- close()[source]¶
Close this specific bot position. This is only valid during market hours and while the bot is set to Enabled or Disable on Close. Auth Required: Write Positions
- current_ask : float | None¶
Current ask
- current_bid : float | None¶
Current bid
- current_delta : float | None¶
Current delta
- current_mid : float | None¶
Current mid
- current_profit : float | None¶
Current profit
- ending_balance : float | None¶
Ending balance
- entered_at : datetime¶
Entered at
- entry_ask : float¶
Entry ask
- entry_bid : float¶
Entry bid
- entry_price : float¶
Entry price
- entry_value : float¶
Entry value
- exit_ask : float | None¶
Exit ask
- exit_bid : float | None¶
Exit bid
- exit_price : float | None¶
Exit price
- exit_value : float | None¶
Exit value
- exited_at : datetime | None¶
Exited at
- is_paper : bool¶
If this is a paper position
- legs : List[PositionLeg]¶
Legs
- max_risk : float¶
Max risk
- number : str¶
Position number
- profit_dollars : float | None¶
Profit dollars
- starting_balance : float¶
Starting balance
- status : Literal['OPEN', 'CLOSED']¶
Position status
- symbol : str¶
Symbol
- tags : str¶
Tags
- type : str¶
Type
- underlying_at_entry : float¶
Underlying at entry
- underlying_at_exit : float | None¶
Underlying at exit
- vix_at_entry : float¶
VIX at entry
- vix_at_exit : float | None¶
VIX at exit
- class whispertrades.position.PositionLeg(*, status: 'OPEN' | 'CLOSED', type: 'CALL' | 'PUT', action: 'SELL_TO_OPEN' | 'BUY_TO_OPEN' | 'BUY_TO_CLOSE' | 'SELL_TO_CLOSE', instrument: str, expiration_date: date, days_to_expiration: int, days_to_expiration_at_exit: int | None, strike_price: float, quantity: int, quantity_open: int, entered_at: datetime, exited_at: datetime | None, entry_bid: float, entry_ask: float, entry_price: float, exit_bid: float | None, exit_ask: float | None, exit_price: float | None, current_bid: float | None, current_mid: float | None, current_ask: float | None, current_profit: float | None, current_delta: float | None, profit_dollars: float | None, delta_at_entry: float, delta_at_exit: float | None, iv_at_entry: float, iv_at_exit: float | None, held_to_expiration: bool | None, assigned: bool | None, exercised: bool | None)[source]¶
Bases:
BaseModel- action : Literal['SELL_TO_OPEN', 'BUY_TO_OPEN', 'BUY_TO_CLOSE', 'SELL_TO_CLOSE']¶
- assigned : bool | None¶
- current_ask : float | None¶
- current_bid : float | None¶
- current_delta : float | None¶
- current_mid : float | None¶
- current_profit : float | None¶
- days_to_expiration : int¶
- days_to_expiration_at_exit : int | None¶
- delta_at_entry : float¶
- delta_at_exit : float | None¶
- entered_at : datetime¶
- entry_ask : float¶
- entry_bid : float¶
- entry_price : float¶
- exercised : bool | None¶
- exit_ask : float | None¶
- exit_bid : float | None¶
- exit_price : float | None¶
- exited_at : datetime | None¶
- expiration_date : date¶
- held_to_expiration : bool | None¶
- instrument : str¶
- iv_at_entry : float¶
- iv_at_exit : float | None¶
- profit_dollars : float | None¶
- quantity : int¶
- quantity_open : int¶
- status : Literal['OPEN', 'CLOSED']¶
- strike_price : float¶
- type : Literal['CALL', 'PUT']¶
- class whispertrades.position.PositionResponse(*, number: str, status: 'OPEN' | 'CLOSED', bot: BasicBot, broker_connection: BaseBrokerConnection, is_paper: bool, tags: str, symbol: str, type: str, entered_at: datetime, exited_at: datetime | None, entry_bid: float, entry_ask: float, entry_price: float, exit_bid: float | None, exit_ask: float | None, exit_price: float | None, broker_fee: float | None, current_bid: float | None, current_mid: float | None, current_ask: float | None, current_profit: float | None, current_delta: float | None, entry_value: float, exit_value: float | None, max_risk: float, profit_dollars: float | None, starting_balance: float, ending_balance: float | None, underlying_at_entry: float, underlying_at_exit: float | None, vix_at_entry: float, vix_at_exit: float | None, legs: list[PositionLeg])[source]¶
Bases:
BaseModel- broker_connection : BaseBrokerConnection¶
- broker_fee : float | None¶
- current_ask : float | None¶
- current_bid : float | None¶
- current_delta : float | None¶
- current_mid : float | None¶
- current_profit : float | None¶
- ending_balance : float | None¶
- entered_at : datetime¶
- entry_ask : float¶
- entry_bid : float¶
- entry_price : float¶
- entry_value : float¶
- exit_ask : float | None¶
- exit_bid : float | None¶
- exit_price : float | None¶
- exit_value : float | None¶
- exited_at : datetime | None¶
- is_paper : bool¶
- legs : list[PositionLeg]¶
- max_risk : float¶
- number : str¶
- profit_dollars : float | None¶
- starting_balance : float¶
- status : Literal['OPEN', 'CLOSED']¶
- symbol : str¶
- tags : str¶
- type : str¶
- underlying_at_entry : float¶
- underlying_at_exit : float | None¶
- vix_at_entry : float¶
- vix_at_exit : float | None¶