masanorihirano / pams

PAMS: Platform for Artificial Market Simulations
https://pams.hirano.dev
Eclipse Public License 1.0
41 stars 5 forks source link

Hashimoto/darkpool #75

Closed ryuji-hashimoto0110 closed 1 year ago

ryuji-hashimoto0110 commented 1 year ago

correct typo

in runners/sequential.py line 219, change f"market class for {name} does not inherit Market class" to f"agent class for {name} does not inherit Agent class".

DarkPool

darkpool_market.py, agents/darkpool_agent.py

Usage

config = {
    "simulation": {
        "markets": ["litMarket", "DarkPoolMarket"],
        "agents": ["DarkPoolFCNAgents"],
        "sessions": [
            {   "sessionName": 0,
                "iterationSteps": 100,
                "withOrderPlacement": True,
                "withOrderExecution": False,
                "withPrint": True,
                "hiFrequencySubmitRate": 1.0
            },
            {   "sessionName": 1,
                "iterationSteps": 4000,
                "withOrderPlacement": True,
                "withOrderExecution": True,
                "withPrint": True
            }
        ]
    },
    "litMarket": {
        "class": "Market",
        "tickSize": 0.00001,
        "marketPrice": 300.0,
    },
    "DarkPoolMarket": {
          "class": "DarkPoolMarket",
          "litMarket": "litMarket",
          "tickSize": 0.00001,
          "marketPrice": 300.0
    },
    "DarkPoolFCNAgents": {
        "class": "DarkPoolFCNAgent",
        "numAgents": 100,
        "markets": ["litMarket", "DarkPoolMarket"],
        "DarkPoolMarket": "DarkPoolMarket",
        "assetVolume": 50,
        "cashAmount": 10000,
        "fundamentalWeight": {"expon": [1]},
        "chartWeight": {"expon": [1.0]},
        "noiseWeight": {"expon": [1.0]},
        "meanReversionTime":{"uniform":[50,100]},
        "noiseScale": 0.001,
        "timeWindowSize": [100, 200],
        "orderMargin": [0.0, 0.1],
        "d": 0.1,
    }
}
saver = MarketStepSaver()
runner = SequentialRunner(
    settings=config,
    prng=random.Random(42),
    logger=saver
)
runner.class_register(DarkPoolFCNAgent)
runner.class_register(DarkPoolMarket)
runner.main()
codecov[bot] commented 1 year ago

Codecov Report

Merging #75 (b88903e) into main (e91eb7e) will decrease coverage by 1.22%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
- Coverage   94.83%   93.61%   -1.22%     
==========================================
  Files          50       52       +2     
  Lines        4297     4353      +56     
==========================================
  Hits         4075     4075              
- Misses        222      278      +56     
Flag Coverage Δ
pytest 93.61% <0.00%> (-1.22%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pams/agents/darkpool_agent.py 0.00% <0.00%> (ø)
pams/darkpool_market.py 0.00% <0.00%> (ø)
pams/runners/sequential.py 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.