FCNAgent#

class pams.agents.FCNAgent(agent_id, prng, simulator, name, logger=None)[source]#

FCN (Fundamental, Chartist, Noise) Agent class

This class inherits from the pams.agents.Agent class.

An order decision mechanism proposed in Chiarella & Iori (2004). It employs two simple margin-based random tradings. Given an expected future price p, submit an order of price

  • “fixed” : \(p (1 ± k)\) where \(0 \leq k \leq 1\)

  • “normal” : \(p + N(0, k)\) where \(k > 0\)

References

is_finite(x)[source]#

determine if it is a valid value.

Parameters:

x (float) – value.

Returns:

whether or not it is a valid (not NaN, finite) value.

Return type:

bool

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

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

Parameters:
  • settings (Dict[str, Any]) – agent configuration. This can include the parameters “fundamentalWeight”, “chartWeight”, “noiseWeight”, “noiseScale”, “timeWindowSize”, “orderMargin”, “marginType”, and “meanReversionTime”.

  • accessible_markets_ids (List[int]) – list of market IDs.

Return type:

None

Returns:

None

submit_orders(markets)[source]#

submit orders based on FCN-based calculation. :rtype: List[Union[Order, Cancel]]

submit_orders_by_market(market)[source]#

submit orders by market (internal usage).

Parameters:

market (Market) – market to order.

Returns:

order list.

Return type:

List[Union[Order, Cancel]]