ezyquant_execution.executing.execute_on_timer#

ezyquant_execution.executing.execute_on_timer(settrade_user: Investor | MarketRep, account_no: str, signal_dict: Dict[str, Any], on_timer: Callable[[ExecuteContextSymbol], None], interval: float, start_time: time, end_time: time, pin: str | None = None, event: Event | None = None)#

Execute.

To stop execute on timer, raise exception in on_timer to stop immediately, or set event.set() to stop after current iteration.

Parameters:
  • settrade_user (Investor) – settrade sdk user.

  • account_no (str) – account number.

  • signal_dict (Dict[str, Any]) – signal dictionary. symbol as key and signal as value. this signal will pass to on_timer.

  • on_timer (Callable[[ExecuteContextSymbol], None]) – custom function that iterate all symbol in signal_dict. if on_timer raise exception, this function will be stopped.

  • interval (float) – seconds to sleep between each iteration.

  • start_time (time) – time to start.

  • end_time (time) – time to end. end time will not interrupt while iteration.

  • pin (str, optional) – pin for investor

  • event (Event, optional) – event to stop execute on timer