How I made a Neural Net that generated $100/Hour.

Cyber_Noob
4 min readDec 13, 2020

Everybody wants to make a quick buck via trading. Some do it as a hobby (not so serious) but there are Institutions and FinCorps that do it professionally as their daily job. If Share Market was considered as a sort of Gamble there wouldn’t be a Wall Street which is now an aspiration for all the young traders out in the wild. Predicting a stock price can have various factors involved such as the stocks’s performance, Future prospects of the company, Asset/Debt ratio, People emotions, News etc. The future is always uncertain. A stock may either rocket to give more than 1500% in a span of 3–5 years or it may tank more than 80% on the same time frame. Take for example, the Covid-19 crash, which made almost all the stocks all over the world to tank to more than 50% which can make a lethal blow to a portfolio.

So how can we do predictions if factors such as News and People’s Emotions are involved?

The idea behind it is simple. Instead of going for longer time scales such as a week or even months, the idea here is to do “High Frequency Intraday Trades” i.e., doing quick trades in a matter of mere seconds or minutes.

The model I have created here tries to predict price movements for every minute so that the model’s performance doesn’t drop due to any news based uncertainties. The model serves as a trend predictor/follower instead of being the entity that sees the future of a stock after 1–5 years or months. The good thing about the model is that it doesn’t follow the market noises, and it does make steady decisions by a trained Neural Networks, so the worst case scenario will be that the model executing 30 trades in a span of 1 Hour resulting in huge Brokerage/Transactional charges.

The features I have used here is the stock’s Opening Price in a time window of 5 units i.e., 5 minutes here for training using a technique called Sliding window.

Sliding Window Technique

After a few Preprocessing techniques, data is fed into an LSTM (Long Short Term Memory) network to predict the outcome of the next minute.

For now the idea I have explained above is still in development phase, and the model generates $100 an hour on a virtual environment where live ticks are fed into the network for predictions. The live ticks data was used from yfinance and I considered to use BTC-USD just for its volatility. Some of the results generated,

Model Predicting on real-time data
Model Metrics
Model Fitting
Daily P/L on real-time market conditions

Drawbacks of the model

  1. Even though the model is able to generate $100/hr it does by taking both long and short positions i.e., Buying and then Selling/ Selling and then Buying back which requires margin.
  2. Brokerage and other transaction costs. on a worst case scenario the model would execute 30 trades in an hour (Buy/Sell cycle) for which the model has to compensate by generating profits more than these transactional and brokerage costs.
  3. Latency. High speed reliable network connection without any dropouts is required so that the order gets executed on time without delays.
  4. Needs very high volatility and high initial investments in order to keep the model running. Even in this example it is considered to trade with 1BTC which is equivalent to $18405.10 at cmp.

Future Works

I plan on tweaking this project to make it available to common retail traders which can run on low investments and with high efficiency.

End Notes

Basically what I have developed can be called a scalping machine which follows the trends with hopes of generating profits for the user within a short span of time. I would love to further work on such trading bots which are robust and beneficial for the user. If you are interested to know more about the project, do feel free to check out my GitHub link provided below which has the complete documentation/implementation of the project and feel free to connect with me for any queries and collaborations for building a trading bot.

Mail: ajay0912.dpi@gmail.com

GitHub: https://github.com/cyber-noob/Bitcoin-Scalping-using-Neural-Network

--

--

Cyber_Noob

I am a tech enthusiast always up for the challenge. I am currently doing Fourth year of my Bachelor's degree. A market enthusiast and part time Trader/Investor.