EventABC#

class pams.events.EventABC(event_id, prng, session, simulator, name)[ソース]#

event base class (ABC class).

It defines what the event is. All events should inherit this class.

abstract hook_registration()[ソース]#

Define when this event should be hooked by simulator. This method is automatically hooked by simulator at the beginning of simulation. You must implement this.

戻り値:

The list of event hook ( EventHook )

戻り値の型:

List[EventHook]

hooked_after_cancel(simulator, cancel_log)[ソース]#

This method is hooked after order cancellations if you set the event hook.

パラメータ:
  • simulator (Simulator) -- simulator for reference.

  • cancel_log (CancelLog) -- cancel order submitted.

戻り値の型:

None

hooked_after_execution(simulator, execution_log)[ソース]#

This method is hooked after order executions if you set the event hook.

パラメータ:
戻り値の型:

None

hooked_after_order(simulator, order_log)[ソース]#

This method is hooked after order placements if you set the event hook. Please be careful that the order haven't yet been executed if it could be executed immediately.

パラメータ:
  • simulator (Simulator) -- simulator for reference.

  • order_log (OrderLog) -- order accepted.

戻り値の型:

None

hooked_after_session(simulator, session)[ソース]#

This method is hooked after session ends if you set the event hook.

パラメータ:
  • simulator (Simulator) -- simulator for reference.

  • session (Session) -- session to be ended.

戻り値の型:

None

hooked_after_step_for_market(simulator, market)[ソース]#

This method is hooked at each step after market processing if you set the event hook.

パラメータ:
  • simulator (Simulator) -- simulator for reference.

  • market (Market) -- market processed.

戻り値の型:

None

hooked_before_cancel(simulator, cancel)[ソース]#

This method is hooked before order cancellations if you set the event hook. Please be careful that the cancel order haven't yet been executed.

パラメータ:
  • simulator (Simulator) -- simulator for reference.

  • cancel (Cancel) -- cancel order submitted.

戻り値の型:

None

hooked_before_order(simulator, order)[ソース]#

This method is hooked before order placements if you set the event hook. Please be careful that the order haven't yet been accepted by markets and it could be leakage of order information.

パラメータ:
  • simulator (Simulator) -- simulator for reference.

  • order (Order) -- order accepting now.

戻り値の型:

None

hooked_before_session(simulator, session)[ソース]#

This method is hooked before session beginnings if you set the event hook.

パラメータ:
  • simulator (Simulator) -- simulator for reference.

  • session (Session) -- session to be started.

戻り値の型:

None

hooked_before_step_for_market(simulator, market)[ソース]#

This method is hooked at each step before market processing if you set the event hook.

パラメータ:
  • simulator (Simulator) -- simulator for reference.

  • market (Market) -- market to be processed.

戻り値の型:

None

setup(settings, *args, **kwargs)[ソース]#

event setup. Usually be called from simulator/runner automatically.

パラメータ:

settings (Dict[str, Any]) -- agent configuration. Usually, automatically set from json config of simulator.

戻り値の型:

None

戻り値:

None