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:
Return type:

Loan