My custom Fee Model:

  1. class FutuTransactionFeeModel(FeeModel):
  2. def GetOrderFee(self, parameters: OrderFeeParameters) -> OrderFee:
  3. order = parameters.Order
  4. price = order.price
  5. count = order.quantity
  6. security = parameters.security
  7. return OrderFee(CashAmount(0.5, security.Currency.Symbol))

 


set my custon fee model:

  1. self.equities[stock_name].set_fee_model(FutuTransactionFeeModel())

 


but when this called in ondata method ,error comes:

  1. holding_stock = self.portfolio[stock_symbol]
  2. stock_unrealized_profit = holding_stock.unrealized_profit
  1. Runtime Error: FutuTransactionFeeModel.GetOrderFee() takes 2 positional arguments but 3 were given
  2. at update_holding_stock_delta
  3. stock_unrealized_profit = holding_stock.unrealized_profit

I don't konw why this error comes and what can i do ,anyone can help me ?

 

Author

Sean Sean Sean

January 2025