#Material
Take a sneak peek here
Material is a website/blog frontend based on Material Design.
Trade using DRL algorithms on tensorflow2 and tf-agents
License: MIT License
#Material
Take a sneak peek here
Material is a website/blog frontend based on Material Design.
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>)`
Hi
can you explain ,how I can predict next day, i.e tomorrow from currently day, and get actions
buy/sell/hold ?
thx!
in devcontainer.json change:
"postCreateCommand": "apt-get update && apt-get install -y git && pip3 install ipykernel",
Backtest plot is not working with finrl Version: 0.3.0 and pyfolio Version: 0.9.2
Hi!
If you want you can update your py_env_trading from FinRL repo [/env_stocktrading_stoploss.py])
It has some changes
thx! ))
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.