IndexMarket#

class pams.IndexMarket(market_id, prng, simulator, name, logger=None)[source]#

Index of market.

This class inherits from the pams.market.Market class.

compute_fundamental_index(time=None)[source]#

compute fundamental index.

Parameters:

time (int, Optional) – time step.

Returns:

fundamental index.

Return type:

float

Note

In an index market, there are two types of fundamental values:
  1. fundamental value set from outside such as runner (pams.index_market.IndexMarket.compute_fundamental_index())

  2. fundamental value calculated from components’ fundamental value (pams.index_market.IndexMarket.get_fundamental_index(),

    pams.index_market.IndexMarket.get_fundamental_price())

In usual usage, those become the same. But, in some special usage, it could be differ. This method return 1st one.

compute_market_index(time=None)[source]#

compute market index.

Parameters:

time (int, Optional) – time step.

Returns:

market index.

Return type:

float

get_components()[source]#

get components.

Returns:

list of components.

Return type:

List[pams.market.Market]

get_fundamental_index(time=None)[source]#

get fundamental index.

Parameters:

time (int, Optional) – time step.

Returns:

fundamental index.

Return type:

float

Note

In an index market, there are two types of fundamental values:
  1. fundamental value set from outside such as runner (pams.index_market.IndexMarket.compute_fundamental_index())

  2. fundamental value calculated from components’ fundamental value (pams.index_market.IndexMarket.get_fundamental_index(),

    pams.index_market.IndexMarket.get_fundamental_price())

In usual usage, those become the same. But, in some special usage, it could be differ. This method return 2nd one.

get_index(time=None)[source]#

get market index.

Parameters:

time (int, Optional) – time step.

Returns:

market index.

Return type:

float

get_market_index(time=None)[source]#

get computed market index.

Parameters:

time (int, Optional) – time step.

Returns:

market index.

Return type:

float

is_all_markets_running()[source]#

get whether all markets is running or not.

Returns:

whether all markets is running or not.

Return type:

bool

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

setup market configuration from setting format.

Parameters:

settings (Dict[str, Any]) – market configuration. Usually, automatically set from json config of simulator. This must include the parameter “markets”. This should include the parameter “requires”.

Return type:

None

Returns:

None