Code Monkey home page Code Monkey logo

tradinggym's Issues

找不到csv数据

找不到csv数据,不知道数据的格式,能不能发一份数据上来.

Hi, I can't download on a mac

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

Missing .csv file(s)

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?

ModuleNotFoundError: No module named 'trading'

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'

Not working when using .csv file as source of data

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!

ModuleNotFoundError: No module named 'trading_spread'

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'"

Possible collaboration?

Hi, we are working on a similar project. Would you like to collab on one project together?

Let me know

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.