PriceLimitRule#

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

This limits the price range.

The order having the price that is out of the price range, the price is overridden to the edge of range. This event is only called via hooked_before_order() at designated step.

get_limited_price(order, market)[ソース]#

Calculate the limited price for an order.

パラメータ:
  • order (Order) -- order whose price is calculated

  • market (Market) -- market that order belongs to

戻り値:

price after price limit. If the input order is market order, the return become None (market order).

戻り値の型:

Optional[float]

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_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

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 "enabled". The parameter "referenceMarket" is obsoleted.

戻り値の型:

None

戻り値:

None