RL-Stock is a research project that explores whether a type of artificial intelligence called deep reinforcement learning can be trained to trade stocks automatically and profitably. The README is written in Chinese and describes an experiment created after the author suffered losses in the Chinese stock market during the COVID-19 period. Reinforcement learning works by having an AI agent take actions (in this case: buy, sell, or hold a stock) and receive rewards or penalties based on the outcome. Over many simulated trading sessions, the agent gradually learns which actions lead to profit. This is different from approaches that simply predict whether a stock price will go up or down, here the agent decides a full sequence of trading actions to maximize total return. The project builds a simulated stock trading environment using OpenAI Gym, a standard framework for reinforcement learning experiments. The agent observes daily market data for a stock: opening price, closing price, high, low, trading volume, price-to-earnings ratio, and similar figures. Based on those inputs it decides how much of the stock to buy or sell that day. If the agent ends a session with more money than it started with, it gets a positive reward, losses give it a large penalty (-100) to discourage losing trades. The AI model used is PPO (Proximal Policy Optimization), a well-regarded algorithm from OpenAI that works well when actions are continuous values rather than simple yes/no choices. Historical stock data comes from baostock, a free Chinese securities data platform. The dataset covers over 20 years of data for Shanghai-listed stocks, split into a training portion and a one-month test period. The reported results across 1,002 Chinese stocks show the strategy produced profit on 44.5% of stocks, broke even on 46.5%, and lost money on 9%. The author notes the approach is experimental, meant as a learning exercise rather than financial advice, and cannot guarantee real-world effectiveness.
← wangshub on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.