ezyquant.backtesting.account.SETAccount.match_order_if_possible#

SETAccount.match_order_if_possible(matched_at: datetime, symbol: str, volume: float, price: float)#

Buy/Sell with enough cash/position. skip if price is invalid (<=0, NaN). Volume don’t need to be rounded to 100.

Parameters:
  • matched_at (datetime) – matched datetime

  • symbol (str) – symbol

  • volume (float) – Volume positive for buy and negative for sell (Volume don’t need to be rounded to 100).

  • price (float) – price