create_short_loan#
API documentation for tradeexecutor.strategy.lending_protocol_leverage.create_short_loan Python function.
- create_short_loan(position, trade, timestamp, mode='plan')[source]#
Create the loan data tracking for short position.
Check that the information looks correct for a short position.
Populates
Loan
data structure.We use assumed prices. The actual execution prices may differ and must be populated to trade.executed_loan.
- Parameters:
position (tradeexecutor.state.position.TradingPosition) –
trade (TradeExecution) –
timestamp (datetime) –
mode (Literal['plan', 'execute']) –
- Return type: