Binance implementation
Closed this issue · 5 comments
Hello,
I played around with your code. Fantastic job really... Thanks for sharing.
The code and trained agent can beat not only historical data that is trained on but also a data that agent never saw.
I made some tests on bull, bear and sideway markets. Models it learned can bring a profit of 10-20% in one week (I am looking into 5 minutes candle sticks and testing on the 1 week period, around 2000 points). After I got satisfying results I decided to write some lines so that I can implement this in real life with a small money.
But I am a little unsure about the approach...
What I am thinking now is the following:
- connect binance web socket to get 5 minute klines
- once the candle is closed and if the 1 week historical data exists - if not, download 1 week historical data- append the closed candle into the historical data.
- make a test based on the last weeks data
- get the last action on the last candle (0, 1, 2: Hold, Buy, Sell) provided that net_worth of the episode is more than 10% and implement that action in binance.
As I said I am a little unsure if this is the correct approach.
Any thoughts?
PS. I can not, by no means, claim that I am a coder. I can read, understand and alter but the things I try are probably are far from efficiency :)
Anyways... Hope you guys have some thoughts so that we can put this fantastic code one step further...
I would be careful with using this in a real environment. I think the author made a mistake with the way he sets his prices. For example, he sets current price to the open price.
This means that the agent is able to look ahead in time, as the agent is also aware of the close price for the same timestep, but is still able to execute at the open price. This is a form of lookahead bias; the agent might simply look at the open price, see that the close is higher and then choose to buy. In real life, you wouldn't know the close until after that time period has passed.
So although the work that he does is really cool and impressive, it will likely not beat the market in a real trading situation.
is abandon project ,no binance implementation is posible
The point was to provide a tutorial and he did that. I'm not sure why you were expecting a fully useable implementation. This is open source, make the interface yourself in a fork.
is abandon project ,no binance implementation is posible
The point was to provide a tutorial, and he did that. I'm not sure why you were expecting a fully useable implementation. This is open source, make the interface yourself in a fork.
Thanks for a good word. Yes, I created these tutorials not to risk everyone's money and let it make profitable trades out of the box. It's far from the stage where we could be using it in the real market. And if someday I will think about doing a public bot to make these trades on the real market, I would be making some subscriber fees to improve it constantly. To create such things requires an enormous amount of time and knowledge.
No one should expect to get a perfectly working AI bot beating the market for free. That's a dream.
When I started this thread, I had only in mind to see how this bot would act in a real world. At the end of the day it is always very nice to see if you get results.
this is definitely not a get rich quick scheme/code.
But thanks to this code I got to learn so much about RL and ideas/methods behind.
I am still exploring the code and learning. I don't know how many times I destroyed the code and started over :D (I know I am not the best person to keep track of the work)
But thanks to the author of this code and I wish your good work continues to educate others about machine learning and principles.
My advice to others is to google other platforms that has AI driven bots that you can buy the service for a small fee.
And this code is a tutorial to understand what is behind those bots.
closing this thread since I believe that binance or other exchange implementations will be subject to individual work with its own risks.