adrianp- / gym_trading Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
I have been playing around with implementing an updating chart with the gym.envs.classic_control.rendering object, as seen in https://github.com/openai/gym/blob/master/gym/envs/classic_control/pendulum.py
I added a variable 'self.data' to save the data, and
def render(self, mode='human'):
if self.viewer is None:
print("Creating the rendering view:")
self.viewer = rendering.Viewer(640, 480)
fig = self.data.plot().get_figure()
filename = './plot.png'
fig.savefig(filename)
plt.close('all')
self.img = rendering.Image(filename, 640., 480.)
self.imgtrans = rendering.Transform()
self.img.add_attr(self.imgtrans)
self.viewer.add_onetime(self.img)
return self.viewer.render(return_rgb_array = mode =='rgb_array')
However only a white image window appears. The png file is fine, but it doesn't show in self.viewer. I've not been able to find much information on this. Any thoughts?
There is a case when Baseline DQN Gym_Trading Tutorial.ipynb
fails with KeyError
Profit
. It happens when agent the whole episode choose only 0
and 3
actions. This results in that neither this line
gym_trading/gym_trading/envs/portfolio.py
Line 68 in af5767a
gym_trading/gym_trading/envs/portfolio.py
Line 83 in af5767a
portfolio.journal
remains empty. Consequently, line
profit = journal["Profit"].sum()
in Jupyter notebook crashes.
isse when executing this " with U.make_session(8): "
the error is:
TypeError: config must be a tf.ConfigProto, but got <class 'int'>
i am having tensorflow version 1.5
please help
Hi,
I'm using gym_trading to learn about RL for algotrading.
Compared to some simple models I did with RNNs I noticed the learning takes significantly longer.
So I switched to running it on my 2080 ti. Runs a bit faster than on CPU.
But then I notice the total GPU utilization is only about 7-10% and that's on a desktop machine.
Is there a way I can speed up the learning and use more GPU power?
Calculating max values in such way results in that Trading Duration
and Open Trade
dimensions have max values equal to 0.0
, which is wrong.
gym_trading/gym_trading/envs/simulator.py
Line 32 in af5767a
gym_trading/gym_trading/envs/feature_engineering.py
Lines 15 to 16 in af5767a
Hi @AdrianP- !
First of all, many thanks for this repo! For me, it's the clearest and features-rich at the same time among many other trading gyms.
Sorry for using issues for asking the questing, but I haven't found any contacts on your GitHub page.
Can you please clarify the difference between reward
and Profit
?
Adrian is possible for you to put together a notebook to integrate it with IB for paper trading or demo trading in a simple realtime test environment
I try to create a new environnment but I have a problem :
Traceback (most recent call last):
File "test.py", line 16, in
env = gym.make('trading-v0')
File "/home/nicolas/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 163, in make
return registry.make(id)
File "/home/nicolas/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 121, in make
patch_deprecated_methods(env)
File "/home/nicolas/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 181, in patch_deprecated_methods
env.seed = env._seed
AttributeError: 'TradingEnv' object has no attribute '_seed'
Versions :
gym (0.9.6)
Does it requires an older version of gym ?
gym_trading/gym_trading/envs/portfolio.py
Line 18 in af5767a
config must be a tf.ConfigProto, but got <class 'int'>
I get this error and I wasn't able to resolve.
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.