Kismuz / btgym

Scalable, event-driven, deep-learning-friendly backtesting library
https://kismuz.github.io/btgym/
GNU Lesser General Public License v3.0
985 stars 260 forks source link

No running server found #1

Closed shokimble closed 7 years ago

shokimble commented 7 years ago

Hi,

Great work.

I was looking for examples of market trading environments for OpenAI for an idea I had around machine learning for risk management (I don't think you can teach a computer to trade on random walk data better than you can teach a human - it's like locking both in a box and hoping they can make money) but what I am hoping you can do is teach them risk management/position sizing based on prevailing market conditions which has much more useful applications.

Hooking OpenAI into Backtrader turns out to be more than I could hope for.

Just one issue I ran into which might be worth noting for others or updating your documentation...

When running your examples they all (or at least all the ones I tried) log "No running server found." then exit.

The issue is that you haven't got an agent running. It might be worth demonstrating a basic agent. Eg:

env = .......... env.reset() for _ in range(1000): env.render() env.step(env.action_space.sample()) # take a random action

Kismuz commented 7 years ago

Hi @shokimble,

  1. Be sure to update by git pull as changes are made almost every day.
  2. "No running server found." message is ok when making environment since server autostart when calling env.reset() for first time.
  3. Take a look at https://github.com/Kismuz/btgym/blob/master/examples/setting_up_environment_basic.ipynb for basic random agent loop.
  4. To mention, no env.render() implemented yet.
Kismuz commented 7 years ago

Refined log message.

Kismuz commented 7 years ago

Basic env rendering implemented. Example notebook updated.