OrderMistakeShock#

class pams.events.OrderMistakeShock(event_id, prng, session, simulator, name)[source]#

This suddenly changes the market price.

It is as a consequence of a fat finger error, e.g., caused by a huge amount of orders at an extremely cheap or expensive price.

This event is only called via hooked_before_step_for_market() at designated step.

hook_registration()[source]#

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.

Returns:

The list of event hook ( EventHook )

Return type:

List[EventHook]

hooked_before_order(simulator, order)[source]#

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.

Parameters:
  • simulator (Simulator) – simulator for reference.

  • order (Order) – order accepting now.

Return type:

None

setup(settings, *args, **kwargs)[source]#

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

Parameters:

settings (Dict[str, Any]) – agent configuration. Usually, automatically set from json config of simulator. This must include the parameters “target”, “triggerTime”, “priceChangeRate”, “orderVolume”, and “orderTimeLength”. This can include the parameters “enabled”.

Return type:

None

Returns:

None