Giter VIP home page Giter VIP logo

pams's Introduction

pams

PAMS: Platform for Artificial Market Simulations

python pypi CI downloads code style: black Codacy Badge codecov

Documentations & User Guides

Documentations are available on readthedoc

Install

This package is available on pypi as pams

$ pip install pams
$ python
>> import pams

Citation

If you consider cite our work, please use the following arxiv entry:

@misc{Hirano2023-pams,
    title={{PAMS: Platform for Artificial Market Simulations}},
    author={Masanori HIRANO, Ryosuke TAKATA, Kiyoshi IZUMI},
    year={2023},
    doi = {10.48550/arXiv.2309.10729}
}

https://arxiv.org/abs/2309.10729

If you prefer to cite this package directly, please use the following bibtex entry:

@misc{Hirano2022-pams,
    title={{PAMS: Platform for Artificial Market Simulations}},
    author={Masanori HIRANO, Ryosuke TAKATA, Kiyoshi IZUMI},
    year={2022},
    url = {https://github.com/masanorihirano/pams}
}

Issues and Contribution

About issues (bugs):

  • You can report issues here.
  • There are no guarantee to support or fix those issues.

Contributions:

  • You can send pull requests (PRs) to this repository.
  • But, there are no guarantee to merge your PRs.

pams's People

Contributors

masanorihirano avatar bonochof avatar actions-user avatar

Stargazers

Furkan Karadaş avatar Charaf ZGUIOUAR avatar Yusuke FURUKAWA avatar  avatar 椎名 avatar Andrey avatar arks22 avatar  avatar  avatar ramune avatar Hyperreal Haberdasher avatar  avatar  avatar  avatar Evgeniy avatar C H avatar FeelinLucky avatar Vladislav Sorokin avatar Reona Sato avatar Yutaro avatar Taishi Nakashima avatar Takato Ueno avatar Niwatoro/にわとろ avatar Soichiro Ota avatar  avatar shilik avatar  avatar shimao avatar  avatar nhnmomonga avatar Yusuke Yamaguchi avatar yoshihiro1909 avatar  avatar  avatar Hiroki Sakaji avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Takato Ueno avatar

pams's Issues

drop python 3.7 support

We can drop python 3.7 support because google colab was updated to python 3.8
After dropping python 3.7,

  • we can use Final typing
  • possibly, we can follow PEP585 . It mean that we should use tuple, list dict, set, and type instead of Tuple, List, Dict, Set, Type.

Support agent modified orders

Because of python, we cannot protect orders submitted once.
Therefore, agents can modify the submitted orders if they store submitted order instances.

pams simulation architecture limit the chance agent can modify the orders because usually agents can act something only in submit_orders methods.
However, we should consider the processing of modified orders.

Due to the original plhamJ implementation, currently there is no way to modify the submitted orders and only thing agents can do is cancel orders and submit new orders.

Note: todo is written here:

# ToDo: Agent modification will be handled in simulator

Support get_XXXX_by_name in simulator or not?

In the original plhamJ package, some getXXXXByName methods are implemented to simulator.

https://github.com/plham/plhamJ/blob/7702c3ac6372766fa3acdfc2870384ae941ff9cc/core/src/main/java/plham/core/main/Simulator.java#L216-L234

In pams, I think simulator.name2market can be a replacement.

self.name2market: Dict[str, Market] = {}

But, if those methods are necessary for the certain purpose, we should consider the implementation again.
If not, we should drop the following ToDo:

# ToDo get_xxx_by_name

Add tests

  • fundamentals.py
  • index_market.py
  • market.py
  • order.py
  • order_book.py
  • session.py
  • simulator.py
  • agents/arbitrage_agent.py
  • agents/base.py
  • agents/fcn_agent.py
  • agents/high_frequency_agent.py
  • events/base.py
  • events/funamental_price_shock.py
  • logs/base.py
  • logs/market_steps_loggers
  • runners/base.py
  • runners/sequential.py
  • utils/class_finder.py
  • utils/extends.py
  • utils/json_random.py

Add api references

  • fundamentals.py
  • index_market.py
  • market.py
  • order.py
  • order_book.py
  • session.py
  • simulator.py
  • agents/arbitrage_agent.py
  • agents/base.py
  • agents/fcn_agent.py
  • agents/high_frequency_agent.py
  • events/base.py
  • events/funamental_price_shock.py
  • logs/base.py
  • logs/market_steps_loggers
  • runners/base.py
  • runners/sequential.py
  • utils/class_finder.py
  • utils/extends.py
  • utils/json_random.py

Check the support for user-defined class by find_class

# ToDo check more import
_1 = __import__("pams", globals(), locals())
_2 = __import__("pams.agents", globals(), locals(), ["*"])
_3 = __import__("pams.events", globals(), locals(), ["*"])

Currently, we support the class finder in pams package.
However, for users' convenience, we should support this also for user-defined classes in the main python files such as main.py in samples.

The current implementation might support user-defined classes because we also look into the global and local scopes.
But, I'm not sure about this. Therefore, further investigation is required.

Execution handling for orders placed at the same time

pams/pams/market.py

Lines 547 to 549 in 8090db6

if buy_order.placed_at == sell_order.placed_at:
# ToDo: in the actual market, this doesn't occur
price = buy_order.price

In the simulations, we should consider the rare case that cannot occur in actual markets.
In this case, we faced the case that the orders are placed at the totally same time.
This occurs only when the max_normal_orders is more than 1 or one agent submits the buy and sell order at the same time and executed them, aka. wash sales (仮装売買 in japanese), which is strictly prohibitted.

missing __init__

if init is missing in some components, the same code assigning instance does not work properly. It seems occurring this issue when google colab notebook run twice.

Support direct class setting

Currently, classes are set by a string in config JSON/python dict.

When python dict is used for setting, we should support Type direction in the setting.

For example,

class UserDefinedAgent(Agent):
    pass

setting = {
    ....
    "Agents": {
        "class": UserDefinedAgent,
        ....
    }
}

runner = SequentialRunner(
    settings=config,
    ...
)

...

if it is possible, class_registration to the runner is not necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.