Code Monkey home page Code Monkey logo

drl4trading's Introduction

#Material

Work In Progress.

Take a sneak peek here

Material is a website/blog frontend based on Material Design.

drl4trading's People

Contributors

s-diaco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

drl4trading's Issues

Issue

Hi, thx for this great repo!
After run main module I have an error

What I am doing wrong? Thx!

`0|  58|CASH SHORTAGE  |$1,206,903     |$102,239,481   |-0.00347% |2.23948%  |1.18%     
   0|  59|CASH SHORTAGE  |$1,206,903     |$103,677,086   |0.03796%  |3.67709%  |1.16%     
   0|  60|CASH SHORTAGE  |$1,206,903     |$103,946,007   |0.06128%  |3.94601%  |1.16%     
   0|  61|CASH SHORTAGE  |$1,206,903     |$104,209,808   |0.06469%  |4.20981%  |1.16%     
   0|  62|CASH SHORTAGE  |$1,206,903     |$105,286,984   |0.06790%  |5.28698%  |1.15%     
2021-06-11 21:52:49.424595: W tensorflow/core/framework/op_kernel.cc:1755] Unknown: AssertionError: 
Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/script_ops.py", line 249, in __call__
    ret = func(*args)

  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py", line 645, in wrapper
    return func(*args, **kwargs)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 303, in _isolated_step_py
    return self._execute(_step_py, *flattened_actions)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 212, in _execute
    return fn(*args, **kwargs)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 299, in _step_py
    self._time_step = self._env.step(packed)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/py_environment.py", line 203, in step
    self._current_time_step = self._step(action)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/batched_py_environment.py", line 166, in _step
    time_steps = self._envs[0].step(actions)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/py_environment.py", line 203, in step
    self._current_time_step = self._step(action)

  File "/content/DRL4TSE/env_tse/py_env_trading.py", line 425, in _step
    assert (spend + costs) <= coh

AssertionError


Traceback (most recent call last):
  File "main_notebook.py", line 79, in <module>
    num_parallel_environments=N_PARALLEL_CALLS,
  File "/usr/local/lib/python3.7/dist-packages/gin/config.py", line 1069, in gin_wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "/usr/local/lib/python3.7/dist-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
    raise proxy.with_traceback(exception.__traceback__) from None
  File "/usr/local/lib/python3.7/dist-packages/gin/config.py", line 1046, in gin_wrapper
    return fn(*new_args, **new_kwargs)
  File "/content/DRL4TSE/model/models.py", line 289, in train_PPO
    summary_prefix="Metrics",
  File "/content/DRL4TSE/model/models.py", line 86, in _eval_model
    summary_prefix=summary_prefix,
  File "/usr/local/lib/python3.7/dist-packages/gin/config.py", line 1069, in gin_wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "/usr/local/lib/python3.7/dist-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
    raise proxy.with_traceback(exception.__traceback__) from None
  File "/usr/local/lib/python3.7/dist-packages/gin/config.py", line 1046, in gin_wrapper
    return fn(*new_args, **new_kwargs)
  File "/usr/local/lib/python3.7/dist-packages/tf_agents/eval/metric_utils.py", line 163, in eager_compute
    common.function(driver.run)(time_step, policy_state)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/def_function.py", line 889, in __call__
    result = self._call(*args, **kwds)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/def_function.py", line 957, in _call
    filtered_flat_args, self._concrete_stateful_fn.captured_inputs)  # pylint: disable=protected-access
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/function.py", line 1961, in _call_flat
    ctx, args, cancellation_manager=cancellation_manager))
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/function.py", line 596, in call
    ctx=ctx)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/execute.py", line 60, in quick_execute
    inputs, attrs, num_outputs)
tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.
  (0) Unknown:  AssertionError: 
Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/script_ops.py", line 249, in __call__
    ret = func(*args)

  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py", line 645, in wrapper
    return func(*args, **kwargs)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 303, in _isolated_step_py
    return self._execute(_step_py, *flattened_actions)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 212, in _execute
    return fn(*args, **kwargs)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 299, in _step_py
    self._time_step = self._env.step(packed)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/py_environment.py", line 203, in step
    self._current_time_step = self._step(action)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/batched_py_environment.py", line 166, in _step
    time_steps = self._envs[0].step(actions)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/py_environment.py", line 203, in step
    self._current_time_step = self._step(action)

  File "/content/DRL4TSE/env_tse/py_env_trading.py", line 425, in _step
    assert (spend + costs) <= coh

AssertionError


	 [[{{node driver_loop/body/_1/driver_loop/step/step_py_func}}]]
  (1) Unknown:  AssertionError: 
Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/script_ops.py", line 249, in __call__
    ret = func(*args)

  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py", line 645, in wrapper
    return func(*args, **kwargs)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 303, in _isolated_step_py
    return self._execute(_step_py, *flattened_actions)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 212, in _execute
    return fn(*args, **kwargs)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/tf_py_environment.py", line 299, in _step_py
    self._time_step = self._env.step(packed)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/py_environment.py", line 203, in step
    self._current_time_step = self._step(action)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/batched_py_environment.py", line 166, in _step
    time_steps = self._envs[0].step(actions)

  File "/usr/local/lib/python3.7/dist-packages/tf_agents/environments/py_environment.py", line 203, in step
    self._current_time_step = self._step(action)

  File "/content/DRL4TSE/env_tse/py_env_trading.py", line 425, in _step
    assert (spend + costs) <= coh

AssertionError


	 [[{{node driver_loop/body/_1/driver_loop/step/step_py_func}}]]
	 [[GroupCrossDeviceControlEdges_0/driver_loop/LoopExecuted/_55/_39]]
0 successful operations.
0 derived errors ignored. [Op:__inference_run_959]

Function call stack:
run -> run

  In call to configurable 'eager_compute' (<function eager_compute at 0x7feda7cd3b00>)
  In call to configurable 'train_PPO' (<function TradeDRLAgent.train_PPO at 0x7fed9290e050>)`

predict next day

Hi
can you explain ,how I can predict next day, i.e tomorrow from currently day, and get actions
buy/sell/hold ?
thx!

env

Hi!
If you want you can update your py_env_trading from FinRL repo [/env_stocktrading_stoploss.py]) 
It has some changes
thx! ))

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.