Giter Club home page Giter Club logo

deep_trader's People

Contributors

bryant1410 avatar deependersingla avatar tigerneil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep_trader's Issues

code run error

when I run python dqn_model.py in tensor-reinforcement,i got an error(I have mkdir saved_networks,and get data.pk land data_dict.pkl in tensor-reinforcement):
Traceback (most recent call last):
File "/Users/nicefilm/Documents/code/python/deep-trader/tensor-reinforcement/dqn_model.py", line 11, in
from train_stock import *
File "/Users/nicefilm/Documents/code/python/deep-trader/tensor-reinforcement/train_stock.py", line 23, in
supervised_y_data = episodic_data.make_supervised_data(data, data_dict)
File "/Users/nicefilm/Documents/code/python/deep-trader/tensor-reinforcement/episodic_data.py", line 100, in make_supervised_data
supervised_data.append(episode_supervised_data(episode, data_dict))
File "/Users/nicefilm/Documents/code/python/deep-trader/tensor-reinforcement/episodic_data.py", line 87, in episode_supervised_data
prices.append(data_average_price(data_dict, iteration))
File "/Users/nicefilm/Documents/code/python/deep-trader/tensor-reinforcement/episodic_data.py", line 92, in data_average_price
data = data_dict[list_md5_string_value(data)]
KeyError: '297956b2300474fda50a2a6b1d41a714'

code run error

I copy data from https://drive.google.com/file/d/0B6ZrYxEMNGR-MEd5Ti0tTEJjMTQ/view and https://drive.google.com/file/d/0B6ZrYxEMNGR-Q0YwWWVpVnJ3YmM/view?usp=sharing into tensor-reinforcement directory.

and run python dqn_model.py and get error:

Traceback (most recent call last):
File "/Users/Wilson/github/deep_trader/tensor-reinforcement/dqn_model.py", line 12, in
from train_stock import *
File "/Users/Wilson/github/deep_trader/tensor-reinforcement/train_stock.py", line 23, in
supervised_y_data = episodic_data.make_supervised_data(data, data_dict)
File "/Users/Wilson/github/deep_trader/tensor-reinforcement/episodic_data.py", line 100, in make_supervised_data
supervised_data.append(episode_supervised_data(episode, data_dict))
File "/Users/Wilson/github/deep_trader/tensor-reinforcement/episodic_data.py", line 86, in episode_supervised_data
prices.append(data_average_price(data_dict, iteration))
File "/Users/Wilson/github/deep_trader/tensor-reinforcement/episodic_data.py", line 92, in data_average_price
data = data_dict[key]
KeyError: '297956b2300474fda50a2a6b1d41a714'

Do you want to calculate high + low / 2 for average price?

episodic_data.py#L39
temp = [data[2], data[3], data[4], data[5],data[8]]

episodic_data.py#L56
average_price = sum(temp[0:-2]) / float(len(temp[0:-2])) # (high + low + close ) /3 ?

Do you want to calculate high + low / 2 for average price? If yes, maybe line56 of episodic_data.py should be changed to as below...
average_price = sum(temp[1:-3]) / float(len(temp[1:-3]))

Right?

image

can not install adium-theme-ubuntu in `requirements.txt'

Collecting adium-theme-ubuntu==0.3.4 (from -r requirements.txt (line 1))
  Could not find a version that satisfies the requirement adium-theme-ubuntu==0.3.4 (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for adium-theme-ubuntu==0.3.4 (from -r requirements.txt (line 1))

Tensorflow version?

I get the following error when I run dqn_model.py:

AttributeError: 'module' object has no attribute 'scalar_summary'

What version of tensorflow should I be using with this. I got this error with version 1.2.1.

Singleton array array(<map object at 0x00000190A1D75EF0>, dtype=object) cannot be considered a valid collection

Microsoft Windows [Version 10.0.17134.285]
(c) 2018 Microsoft Corporation. All rights reserved.
Clink v0.4.9 [git:2fd2c2] Copyright (c) 2012-2016 Martin Ridgers
http://mridgers.github.io/clink

Python 3.6 Anaconda

D:\Machine Learning\deep_trader-master\deep_trader-master\tensor-reinforcement>python dqn_model.py
C:\AnacondaPython3_6\DeepLearning_Udemy\lib\site-packages\h5py_init_.py:34: 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
C:\AnacondaPython3_6\DeepLearning_Udemy\lib\site-packages\sklearn\cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
Traceback (most recent call last):
File "dqn_model.py", line 11, in
from train_stock import *
File "D:\Machine Learning\deep_trader-master\deep_trader-master\tensor-reinforcement\train_stock.py", line 25, in
x_train, x_test, y_train, y_test = train_test_split(data, supervised_y_data, test_size=0.10, random_state=123)
File "C:\AnacondaPython3_6\DeepLearning_Udemy\lib\site-packages\sklearn\model_selection_split.py", line 1689, in train_test_split
arrays = indexable(*arrays)
File "C:\AnacondaPython3_6\DeepLearning_Udemy\lib\site-packages\sklearn\utils\validation.py", line 206, in indexable
check_consistent_length(*result)
File "C:\AnacondaPython3_6\DeepLearning_Udemy\lib\site-packages\sklearn\utils\validation.py", line 177, in check_consistent_length
lengths = [_num_samples(X) for X in arrays if X is not None]
File "C:\AnacondaPython3_6\DeepLearning_Udemy\lib\site-packages\sklearn\utils\validation.py", line 177, in
lengths = [_num_samples(X) for X in arrays if X is not None]
File "C:\AnacondaPython3_6\DeepLearning_Udemy\lib\site-packages\sklearn\utils\validation.py", line 126, in _num_samples
" a valid collection." % x)
TypeError: Singleton array array(<map object at 0x00000190A1D75EF0>, dtype=object) cannot be considered a valid collection.

DQN Strategy

I run the code as directed and get this error which I am not able to work through. Please help me with this.
Thanks

C:\Users\Aakash Juneja\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
Traceback (most recent call last):
File "dqn_model.py", line 8, in
from train_stock import *
File "C:\Study Project (CEERI)\tensor_RL\train_stock.py", line 21, in
data = episodic_data.load_data("data.pkl",episode=10)
File "C:\Study Project (CEERI)\tensor_RL\episodic_data.py", line 71, in load_data
data = load_file_data(file)
File "C:\Study Project (CEERI)\tensor_RL\episodic_data.py", line 76, in load_file_data
data = six.moves.cPickle.load(myFile)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x97 in position 0: ordinal not in range(128)

Could not find old network weights

Could not find old network weights
0
Traceback (most recent call last):
File "dqn_model.py", line 251, in
main()
File "dqn_model.py", line 183, in main
agent.perceive(state,action,reward,next_state,done)
File "dqn_model.py", line 91, in perceive
self.train_Q_network()
File "dqn_model.py", line 128, in train_Q_network
self.saver.save(self.session, 'saved_networks/' + 'network' + '-dqn', global_step = self.time_step)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1037, in save
{self.saver_def.filename_tensor_name: checkpoint_file})
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 340, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 564, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 637, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 659, in _do_call
e.code)
tensorflow.python.framework.errors.NotFoundError: saved_networks/network-dqn-3000.tempstate1294467586467070884
[[Node: save/save = SaveSlices[T=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/save/tensor_names, save/save/shapes_and_slices, Variable, Variable/Adam, Variable/Adam_1, Variable_1, Variable_1/Adam, Variable_1/Adam_1, Variable_2, Variable_2/Adam, Variable_2/Adam_1, Variable_3, Variable_3/Adam, Variable_3/Adam_1, beta1_power, beta2_power)]]
Caused by op u'save/save', defined at:
File "dqn_model.py", line 251, in
main()
File "dqn_model.py", line 167, in main
agent = DQN(data_dictionary)
File "dqn_model.py", line 41, in init
self.saver = tf.train.Saver()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 832, in init
restore_sequentially=restore_sequentially)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 500, in build
save_tensor = self._AddSaveOps(filename_tensor, vars_to_save)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 197, in _AddSaveOps
save = self.save_op(filename_tensor, vars_to_save)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 149, in save_op
tensor_slices=[vs.slice_spec for vs in vars_to_save])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/io_ops.py", line 172, in _save
tensors, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 341, in _save_slices
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/op_def_library.py", line 661, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2154, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1154, in init
self._traceback = _extract_stack()

code run problem

when I run python python dqn_model.py in tensor-reinforcement,i got an error(I have mkdir saved_networks,and get data.pk land data_dict.pkl in tensor-reinforcement):
Traceback (most recent call last): File "dqn_model.py", line 11, in <module> from train_stock import * File "/home/deep_trader/tensor-reinforcement/train_stock.py", line 23, in <module> supervised_y_data = episodic_data.make_supervised_data(data, data_dict) File "/home/deep_trader/tensor-reinforcement/episodic_data.py", line 99, in make_supervised_data supervised_data.append(episode_supervised_data(episode, data_dict)) File "/home/deep_trader/tensor-reinforcement/episodic_data.py", line 86, in episode_supervised_data prices.append(data_average_price(data_dict, iteration)) File "/home/deep_trader/tensor-reinforcement/episodic_data.py", line 91, in data_average_price data = data_dict[list_md5_string_value(data)] KeyError: '297956b2300474fda50a2a6b1d41a714'

pg_model vs pg_stock_model

What is the difference between these two files and which one should I use in order to train a deep gradient policy RL agent ?

I tried to run pg_model with several NN architecture but I always have a convergence of the reward around 200, have you tried it before ?

UnicodeDecodeError

when I run it, I encounter the following error:

Warning (from warnings module):
File "C:\Users\ben\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\cross_validation.py", line 41
"This module will be removed in 0.20.", DeprecationWarning)
DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
Traceback (most recent call last):
File "C:\Users\ben\Documents\python\deep_trader\tensor-reinforcement\dqn_model.py", line 11, in
from train_stock import *
File "C:\Users\ben\Documents\python\deep_trader\tensor-reinforcement\train_stock.py", line 22, in
data = episodic_data.load_data("data.pkl",episode=10)
File "C:\Users\ben\Documents\python\deep_trader\tensor-reinforcement\episodic_data.py", line 77, in load_data
data = load_file_data(file)
File "C:\Users\ben\Documents\python\deep_trader\tensor-reinforcement\episodic_data.py", line 82, in load_file_data
data = six.moves.cPickle.load(myFile)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x97 in position 0: ordinal not in range(128)

Can someone help me out here?

Lack of commission charge

I think the most key issue of this repo is lack of commission charge calculate in reward. This should cause the fatal in the real trading.

Data KeyError when run dqn_model.py

I followed the tutorial and download the data into the correct folder, however when i run the model it occurs that data_dict has keyerror. I sincerely hope you teach me how to deal with this problem.

Traceback (most recent call last):
File "/home/vinson/Desktop/deep_trader-master/tensor-reinforcement/dqn_model.py", line 11, in
from train_stock import *
File "/home/vinson/Desktop/deep_trader-master/tensor-reinforcement/train_stock.py", line 23, in
supervised_y_data = episodic_data.make_supervised_data(data, data_dict)
File "/home/vinson/Desktop/deep_trader-master/tensor-reinforcement/episodic_data.py", line 99, in make_supervised_data
supervised_data.append(episode_supervised_data(episode, data_dict))
File "/home/vinson/Desktop/deep_trader-master/tensor-reinforcement/episodic_data.py", line 86, in episode_supervised_data
prices.append(data_average_price(data_dict, iteration))
File "/home/vinson/Desktop/deep_trader-master/tensor-reinforcement/episodic_data.py", line 91, in data_average_price
data = data_dict[list_md5_string_value(data)]
KeyError: '297956b2300474fda50a2a6b1d41a714'

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.