All Projects → philipxjm → Deep Convolution Stock Technical Analysis

philipxjm / Deep Convolution Stock Technical Analysis

Licence: apache-2.0
Uses Deep Convolutional Neural Networks (CNNs) to model the stock market using technical analysis. Predicts the future trend of stock selections.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Deep Convolution Stock Technical Analysis

stox
A Python Module That Uses ANN To Predict A Stocks Price And Also Provides Accurate Technical Analysis With Many High Potential Implementations!
Stars: ✭ 29 (-92.87%)
Mutual labels:  stock-market, stock-price-prediction, technical-analysis
Stock Prediction Models
Gathers machine learning and deep learning models for Stock forecasting including trading bots and simulations
Stars: ✭ 4,660 (+1044.96%)
Mutual labels:  stock-market, stock-price-prediction
hmm market behavior
Unsupervised Learning to Market Behavior Forecasting Example
Stars: ✭ 36 (-91.15%)
Mutual labels:  stock-market, stock-price-prediction
Screeni-py
A Python-based stock screener to find stocks with potential breakout probability from NSE India.
Stars: ✭ 161 (-60.44%)
Mutual labels:  stock-market, technical-analysis
Chase
Automatic trading bot (WIP)
Stars: ✭ 73 (-82.06%)
Mutual labels:  stock-market, stock-price-prediction
TradeTheEvent
Implementation of "Trade the Event: Corporate Events Detection for News-Based Event-Driven Trading." In Findings of ACL2021
Stars: ✭ 64 (-84.28%)
Mutual labels:  stock-market, stock-price-prediction
orderbook modeling
Example of order book modeling.
Stars: ✭ 38 (-90.66%)
Mutual labels:  stock-market, stock-price-prediction
Steward
A stock portfolio manager that provides neural net based short-term predictions for stocks and natural language processing based analysis on community sentiments.
Stars: ✭ 25 (-93.86%)
Mutual labels:  stock-market, stock-price-prediction
StockMarketML
Predicting stocks with ML.
Stars: ✭ 36 (-91.15%)
Mutual labels:  stock-market, stock-price-prediction
Beibo
🤖 Predict the stock market with AI 用AI预测股票市场
Stars: ✭ 46 (-88.7%)
Mutual labels:  stock-market, stock-price-prediction
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (-39.07%)
Mutual labels:  stock-market, technical-analysis
tuneta
Intelligently optimizes technical indicators and optionally selects the least intercorrelated for use in machine learning models
Stars: ✭ 77 (-81.08%)
Mutual labels:  stock-market, technical-analysis
Deep Learning Machine Learning Stock
Stock for Deep Learning and Machine Learning
Stars: ✭ 240 (-41.03%)
Mutual labels:  stock-market, stock-price-prediction
FAIG
Fully Automated IG Trading
Stars: ✭ 134 (-67.08%)
Mutual labels:  stock-market, stock-price-prediction
Stock.indicators
Stock indicator technical analysis library package for .NET. Send in historical price quotes and get back desired technical indicators. Nothing more. It can be used in any market analysis software using standard OHLCV price quotes for equities, commodities, forex, cryptocurrencies, and others. We had private trading algorithms, machine learning, and charting systems in mind when originally creating this community library. Current indicators include: Accumulation/Distribution Line (ADL), Aroon Oscillator, Arnaud Legoux Moving Average (ALMA), Average Directional Index (ADX), Average True Range (ATR), Awesome Oscillator (AO), Balance of Power (BOP), Beta Coefficient, Bollinger Bands®, Chaikin Money Flow (CMF), Chaikin Oscillator, Chandelier Exit, Choppiness Index (CHOP), Commodity Channel Index (CCI), ConnorsRSI, Correlation Coefficient, Donchian Channels, Double Exponential Moving Average (DEMA), Elder-ray Index, Exponential Moving Average (EMA), Force Index, Fractal Chaos Bands (FCB), Gator Oscillator, Heikin-Ashi, Hull Moving Average (HMA), Ichimoku Cloud, Kaufman's Adaptive Moving Average (KAMA), KDJ Index, Keltner Channels, Momentum Oscillator, Money Flow Index (MFI), MESA Adaptive Moving Averages (MAMA), Moving Average Convergence/Divergence (MACD), Moving Average Envelopes, On-balance Volume (OBV), Parabolic SAR (stop and reverse), Percentage Volume Oscillator (PVO), Pivot Points and Rolling Pivot Points, Price Channels, Price (Comparative) Relative Strength (PRS), Price Momentum Oscillator (PMO), Rate of Change (ROC), Relative Strength Index (RSI), R-Squared (Coefficient of Determination), Simple Moving Average (SMA), Slope and Linear Regression, Smoothed Moving Average (SMMA), Standard Deviation, Stoller Average Range Channel (STARC) Bands, Stochastic Oscillator, Stochastic RSI, SuperTrend, Tillson T3 Moving Average, Triple Exponential Moving Average (TEMA), Triple EMA Oscillator (TRIX), True Strength Index (TSI), Ulcer Index, Ultimate Oscillator, Volume Simple Moving Average, Volume Weighted Average Price (VWAP), Vortex Indicator (VI), Weighted Moving Average (WMA), Williams %R, Williams Alligator, Williams Fractal, and Zig Zag.
Stars: ✭ 157 (-61.43%)
Mutual labels:  stock-market, technical-analysis
Stocks
Programs for stock prediction and evaluation
Stars: ✭ 155 (-61.92%)
Mutual labels:  stock-market, stock-price-prediction
Trendyways
Simple javascript library containing methods for financial technical analysis
Stars: ✭ 121 (-70.27%)
Mutual labels:  stock-market, technical-analysis
Simplestockanalysispython
Stock Analysis Tutorial in Python
Stars: ✭ 126 (-69.04%)
Mutual labels:  stock-market, technical-analysis
stock-market-prediction-via-google-trends
Attempt to predict future stock prices based on Google Trends data.
Stars: ✭ 45 (-88.94%)
Mutual labels:  stock-market, stock-price-prediction
stocktwits-sentiment
Stocktwits market sentiment analysis in Python with Keras and TensorFlow.
Stars: ✭ 23 (-94.35%)
Mutual labels:  stock-market, stock-price-prediction

Neural Stock Market Prediction

Uses Deep Convolutional Neural Networks (CNNs) to model the stock market using technical analysis. Predicts the future trend of stock selections.

How does it work?

Convolutional neural networks are designed to recognize complex patterns and features in images. It works by dividing an image up into multiple overlapping perceptive fields and running a myriad of trainable filters through them, capturing basic features and patterns. This process is repeated several times, and as the filtered image is ran through more filters, deeper and more meaningful features are extracted and quantified. For example, to recognize an image of a car we might have several filters that are sensitive to wheels, or windows, or exhaust pipes, or licence plates... and all of the results of these filters are gathered and quantified into a final classifier.

CNN

OK, that's great, but how does this tie in to stock analysis? Here we introduce the study of technical analysis. I'll let Investopedia's words describe it: "Technical analysis is a trading tool employed to evaluate securities and attempt to forecast their future movement by analyzing statistics gathered from trading activity, such as price movement and volume. Unlike fundamental analysts who attempt to evaluate a security's intrinsic value, technical analysts focus on charts of price movement and various analytical tools to evaluate a security's strength or weakness and forecast future price changes." In other words, technical analysis focuses on the movement patterns and trading behaviors of stock selections to pinpoint a stock's future trend. Wait a minute, if technical analysis works by analysing the movement patterns of stocks, we can use CNN to model this analytical technique!

For example, we would have some filters that are sensitive to shortterm uptrends, and they will be combined by fully connected layers to be sensitive to longterm uptrends. The same goes for some complex patterns such as shortterm floats, or an overall downward trend capture.

As previously mentioned, CNN works by stacking several filters on top of each other to form complex feature-sensitive filters; if we were to treat stock data as images, we can apply CNN to it and extract useful and deep information. How do we go about this?

Instead of convolving a 2D image, we convolved a 1D image, since stock data is linear and is represented as an 1D tensor.

def conv1d(input, output_dim,
           conv_w=9, conv_s=2,
           padding="SAME", name="conv1d",
           stddev=0.02, bias=False):
  with tf.variable_scope(name):
    w = tf.get_variable('w', [conv_w, input.get_shape().as_list()[-1], output_dim],
      initializer=tf.truncated_normal_initializer(stddev=stddev))
    c = tf.nn.conv1d(input, w, conv_s, padding=padding)

    if bias:
      b = tf.get_variable('b', [output_dim], initializer=tf.constant_initializer(0.0))
      return c + b

    return c

Also, the input images is in the shape [batch_size, 128, 5], the moving-window (the length of data we will be looking at in one batch) the five channels being [Open, High, Low, Close, Volume], all information I deemed important for technical analysis.

After several convolutional layers and batchnorms later, we arrive at a tensor sized [batch_size, 2, 1024], which we then run through several softmax layers and finally a sigmoid activation to result in a tensor sized [batch_size, 2], with two values, one representing the bullish confidence, and the other one the bearish confidence.

Materials for Consideration

Name Link
Historical Data https://quantquote.com/historical-stock-data
Description of Technical Analysis http://www.investopedia.com/terms/t/technicalanalysis.asp
Berkeley paper on ANN-based analysis http://www.cs.berkeley.edu/~akar/IITK_website/EE671/report_stock.pdf

Data Format

19991118,0,42.2076,46.382,37.4581,39.1928,43981812.87

Date Time Open High Low Close Volume
19991118 0 42.2076 46.382 37.4581 39.1928 43981812.87

Usage

The trained model is proprietary, but you are absolutely welcome to train your own using my code.

You must have python 3.5+ and tensorflow installed, tensorflow-gpu highly recommended as the training requires a lot of computational power.

pip install tensorflow-gpu

git clone https://github.com/philipxjm/Convolutional-Neural-Stock-Market-Technical-Analyser.git

cd Convolutional-Neural-Stock-Market-Technical-Analyser

python stock_model.py

Of course, you have to tinker with the hyper parameters, archeteture of the encoder, and the dataset setup if you want to achieve good results. Good luck and make some money.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].