cove9988 / tradinggym Goto Github PK
View Code? Open in Web Editor NEWTrading Gym is an open source project for the development of reinforcement learning algorithms in the context of trading.
License: MIT License
Trading Gym is an open source project for the development of reinforcement learning algorithms in the context of trading.
License: MIT License
dqn_agent.py and data_reader.py reference "price_usdeur.csv" but this file does not exist. data_reader.py tries to read in "ue2.csv" but this file does not exist.
CSVStreamer.py is commented to indicate that the .csv file to be fed into _generator should have no index column, but it not quite clear what the initial .csv data should look like beyond this. Is it just two columns, one with the bid and the other with the ask price of an asset?
找不到csv数据,不知道数据的格式,能不能发一份数据上来.
Not sure if this has to do with the format of the .csv file I created or not, but when I set "gen_type = 'C'" in "examples/dqn_agent.py" to get data from "./examples/price_2.csv" (which I created), it runs for 2 sessions and then I get the following error:
End of data reached, rewinding.
Traceback (most recent call last):
File "C:\Users\...\AppData\Local\Programs\Python\Python36\lib\site-packages\tgym-0.1.15-py3.6.egg\envs\trading_tick.py", line 130, in step
self._tick_buy,self._tick_sell = next(self._data_generator)
File "C:\Users\...\AppData\Local\Programs\Python\Python36\lib\site-packages\tgym-0.1.15-py3.6.egg\tgym\core.py", line 74, in __next__
raise(e)
File "C:\Users\...\AppData\Local\Programs\Python\Python36\lib\site-packages\tgym-0.1.15-py3.6.egg\tgym\core.py", line 71, in __next__
return next(self.generator)
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "examples/dqn_agent.py", line 189, in <module>
next_state, reward, done, _ = environment.step(action)
File "C:\Users\...\AppData\Local\Programs\Python\Python36\lib\site-packages\tgym-0.1.15-py3.6.egg\envs\trading_tick.py", line 134, in step
info['status'] = 'No more data.'
UnboundLocalError: local variable 'info' referenced before assignment
My .CSV, I have 4,699 rows in total. In column A, I have bid prices (3.4509...) and in column B I have ask prices (3.4511...). Does this have something to do with it? When I run dqn_agent.py using gen_type = 'R' for a random generator, it works fine.
I'm thinking it has something to do with the values in this section here:
` episodes = 50
episode_length = 10000
trading_fee = 0.05
time_fee = 0
history_length = 50
# history_length number of historical states in the observation vector.
profit_taken = 10
stop_loss = -5 # default -5
render_show = False
trading_type = 'T'
if trading_type == 'T':
environment = TickTrading(data_generator=generator, trading_fee=trading_fee, time_fee=time_fee, history_length=history_length, episode_length=episode_length, profit_taken=profit_taken, stop_loss=stop_loss)
action_size = len(TickTrading._actions)
else:
environment = SpreadTrading(spread_coefficients=[1],
data_generator=generator,
trading_fee=trading_fee,
time_fee=time_fee,
history_length=history_length,
episode_length=episode_length)
action_size = len(SpreadTrading._actions)
state = environment.reset()`
...but can't seem to find a working combination. Thoughts? Thanks!
Hi, we are working on a similar project. Would you like to collab on one project together?
Let me know
Hi! I'm South Korean and I want to help you translate README.md to Korean.
Is it okay to translate your README.md?
Thank you.
hi
when I run this code "python C:\Users\jalal\TradingGym\examples\dqn_agent.py" I got below error
how can I fix it?
"C:\Anaconda3\lib\site-packages\h5py_init_.py:36: FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
from ._conv import register_converters as register_converters
Using TensorFlow backend.
Traceback (most recent call last):
File "C:\Users\jalal\TradingGym\examples\dqn_agent.py", line 15, in
from tgym.envs.trading_spread import SpreadTrading
File "C:\Anaconda3\lib\site-packages\tgym\envs_init.py", line 1, in
from trading_spread import SpreadTrading
ModuleNotFoundError: No module named 'trading_spread'"
Hi, I can't download. I use a mac. I need your help. here is my error message:
Pauls-MacBook-Pro:~ paul$ pip3 install https://github.com/cove9988/TradingGym.git
Collecting https://github.com/cove9988/TradingGym.git
Downloading https://github.com/cove9988/TradingGym.git
/ 81kB 467kB/s
Cannot unpack file /private/var/folders/bd/d0vxwn3j5rnfjwnsgy0wp0300000gn/T/pip-wtngrslj-unpack/TradingGym.git (downloaded from /private/var/folders/bd/d0vxwn3j5rnfjwnsgy0wp0300000gn/T/pip-6v70569e-build, content-type: text/html; charset=utf-8); cannot detect archive format
Cannot determine archive format of /private/var/folders/bd/d0vxwn3j5rnfjwnsgy0wp0300000gn/T/pip-6v70569e-build
The wechat qr code is outdated. can renew it, or can you add me in necmetttinkarakaya
感谢repo
python setup.py install
https://github.com/cove9988/TradingGym/blob/master/envs/trading.py#L240
这一行好像错了哦
上面一行还是for呢, 这一行就直接是class了
另外有群加吗, 群的二维码过期了
谢谢!
Using TensorFlow backend.
Traceback (most recent call last):
File "dqn_agent.py", line 15, in
from tgym.envs.trading_spread import SpreadTrading
File "/home/smilewater/anaconda3/lib/python3.6/site-packages/tgym/envs/init.py", line 1, in
from trading import SpreadTrading
ModuleNotFoundError: No module named 'trading'
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.