TradingHaltRule#

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

A trading halt is a market regulation that suspends the trading of some assets.

When the one of targetMarkets violate halting line, all of them will be halted. If you want to halt them separately, please make event separately. The current implementation sets pams.market.Market.is_running() = false when the price changed beyond the prespecified threshold range.

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_execution(simulator, execution_log)[ソース]#

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

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

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. This must include the parameters "targetMarkets" and "triggerChangeRate". This can include the parameters "haltingTimeLength" and "enabled". The parameter "referenceMarket" is obsoleted.

戻り値の型:

None

戻り値:

None