jpmorganchase / abides-jpmc-public Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
This directory in the notebook does not get created by the notebook. Was anyone able to run the module abides-gym? @IdiosyncraticDragon
Hi,
I am currently working on a RL project and want to use ABIDES (Gym) to create a gym market making environment.
I followed the installation instructions and ran the demo_ABIDES-market.ipynb file to test if everthing works correctly.
There is an issue with the NoiseAgent order submission times in the demo, the event time for all submitted orders is logged at 0. Taking a look at the parsed logs dataframe for NoiseAgent and their submitted order with logs_df[ (logs_df.agent_type == "NoiseAgent") & (logs_df.EventType=="ORDER_SUBMITTED") ]
one can see that the event time for every entry is 0.
Their are no issues for any other agent types in the demo file, their event times for submitted orders are in between market open and close. I looked at the files abides-markets/agent/noiseagent.py
as well as at the function parse_logs_df
in abides-markets/utils.py
but could not find a solution.
I am worried that this issue causes problem when setting up a new ABIDES-gym environment and running the rmsc04
market i the background.
Do you have any idea why this problem occurs with NoiseAgents?
Thank you and best, Felix
From compute_fundamental_at_timestamp
mu = s["r_bar"]
gamma = s["kappa"]
theta = s["fund_vol"]
# The OU process is able to skip any amount of time and sample the next desired value
# from the appropriate distribution of possible values.
v = s["random_state"].normal(
loc=mu + (pv - mu) * (exp(-gamma * d)),
scale=((theta) / (2 * gamma)) * (1 - exp(-2 * gamma * d)),
)
np.RandomState.normal's scale argument should be the standard deviation of the OU process, but the variance is passed instead.
The variance for this time step can be verified here https://planetmath.org/ornsteinuhlenbeckprocess
or here
https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process
with cov(x_t, x_t)
Adjusting to scale=np.sqrt(((theta) / (2 * gamma)) * (1 - exp(-2 * gamma * d)))
will at least make the mean reversion consistent with the variance of this step, but I also propose making a symbol change from theta to theta**2 as well for consistency.
The theta parameter is labelled as the "fundamental volatility" of the Brownian motion component of the SDE, but it is being used as the variance of the component following this pull request in the original repository: abides-sim/abides#18
Hi, I am encountering the following error:
TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool.
This code comes from the following line in the policyRL()
class:
self.trainer.restore(best_checkpoint)
I believe there is a problem on the checkpoints fetched by the function:
best_checkpoint = analysis.get_best_checkpoint(trial = best_trial_path, mode='max')
Does anyone know how to solve this?
Hi,
after updating my MacBook, I have noticed a few installation errors and warnings. I have fixed them as follows, but I have thought that you may wanted to take a look at them too.
gym
The pin to version 0.18.0 is problematic, since it gives:
ERROR: Failed building wheel for Pillow
Running setup.py clean for Pillow
Failed to build Pillow
ERROR: Could not build wheels for Pillow, which is required to install pyproject.toml-based projects
Installing the latest version removes this issue. However, note that gym is no longer maintained (see the dev notice at https://github.com/openai/gym).
setup.py / easy_install
The installation steps in the readme file are no longer working on my MacBook. I get a series of warnings along the lines of
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer, pypa/build or
other standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
and a few permission issues at the end. Running it with sudo -H
(after updating requirements.txt
as described above) seems to work fine. However, using sudo -H
may not be advisable for pip.
I just wanted to signal that the documentation link under Usage (regular)
is currently broken.
I have installed ABIDES following the description in the readme file. While rmsc04 works fine, I am having troubles with rmsc03. As soon as I try to import it, I get the following error message:
>>> from abides_markets.configs import rmsc03
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen zipimport>", line 259, in load_module
File "/usr/local/lib/python3.9/site-packages/abides_markets-0.0.0-py3.9.egg/abides_markets/configs/rmsc03.py", line 11, in <module>
ImportError: cannot import name 'POVExecutionAgent' from 'abides_markets.agents' (/usr/local/lib/python3.9/site-packages/abides_markets-0.0.0-py3.9.egg/abides_markets/agents/__init__.py)
Have you ever encountered this error before?
In ValueAgent.updateEstimates()
:
This line provides incorrect sigma_t
estimate, should be:
self.sigma_t = (self.sigma_n * sigma_tprime) / (self.sigma_n + sigma_tprime)
or, equivalentely:
self.sigma_t = sigma_tprime
self.sigma_t = (self.sigma_n * self.sigma_t) / (self.sigma_n + self.sigma_t)
This leads to incorrect r_t
, sigma_t
and r_T
estimates (since start value for sigma_t
is always 0, sigma_t
is always 0).
Hi! When running demo_ABIDES-Markets.ipynb
I get an empty histogram as the one shown below.
After reviewing the code, I identified that abides_core.parse_logs_df
sets the EventTime
of message to zero if the first element of the message is not of type int
or np.int64
(see line 133). It seems that whenever a NoiseAgent
sends an order, the time of such order is interpreted as a float and not an int. I tried finding the line of code that was causing this behavior in the NoiseAgent
class unsuccessfully. However I changed the line 199 in the file abides_core/agent.py
from self.current_time = current_time
to self.current_time = int(current_time)
and the issue seems to have been corrected but I am unsure wether this modification might be messing up other processes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.