All Projects → MSTADreamTeam → MSTA

MSTADreamTeam / MSTA

Licence: other
Multi Strategy Trading Algorithm

Programming Languages

HTML
75241 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to MSTA

Ta4j Origins
A Java library for technical analysis ***Not maintained anymore, kept for archival purposes, see #192***
Stars: ✭ 354 (+941.18%)
Mutual labels:  trading-strategies, technical-analysis
Gekko Strategies
Strategies to Gekko trading bot with backtests results and some useful tools.
Stars: ✭ 1,022 (+2905.88%)
Mutual labels:  trading-strategies, technical-analysis
Techan
Technical Analysis Library for Golang
Stars: ✭ 404 (+1088.24%)
Mutual labels:  trading-strategies, technical-analysis
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+567.65%)
Mutual labels:  trading-strategies, technical-analysis
Machine Learning And Ai In Trading
Applying Machine Learning and AI Algorithms applied to Trading for better performance and low Std.
Stars: ✭ 258 (+658.82%)
Mutual labels:  prediction, trading-strategies
Crypto Signal
Github.com/CryptoSignal - #1 Quant Trading & Technical Analysis Bot - 3,100+ stars, 900+ forks
Stars: ✭ 3,690 (+10752.94%)
Mutual labels:  trading-strategies, technical-analysis
Awesome Quant
A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
Stars: ✭ 8,205 (+24032.35%)
Mutual labels:  trading-strategies, technical-analysis
Stock analysis for quant
Different Types of Stock Analysis in Python, R, Matlab, Excel, Power BI
Stars: ✭ 525 (+1444.12%)
Mutual labels:  trading-strategies, technical-analysis
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+629.41%)
Mutual labels:  trading-strategies, technical-analysis
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (+288.24%)
Mutual labels:  trading-strategies, technical-analysis
yata
Yet Another Technical Analysis library [for Rust]
Stars: ✭ 142 (+317.65%)
Mutual labels:  trading-strategies, technical-analysis
TradeBot
Crypto trading bot using Binance API (Java)
Stars: ✭ 292 (+758.82%)
Mutual labels:  trading-strategies, technical-analysis
Zvt
modular quant framework.
Stars: ✭ 1,801 (+5197.06%)
Mutual labels:  trading-strategies, technical-analysis
Introneuralnetworks
Introducing neural networks to predict stock prices
Stars: ✭ 486 (+1329.41%)
Mutual labels:  prediction, trading-strategies
algorithmic-market-prediction
Implementation of Algorthmic Prediction of Candle Patterns
Stars: ✭ 21 (-38.24%)
Mutual labels:  prediction, technical-analysis
indicado
Technical indicator library for Elixir with no dependencies.
Stars: ✭ 15 (-55.88%)
Mutual labels:  technical-analysis
python-for-decision-makers-course
Demo code and other hand-out materials for our Python for Decision Makers and Business Leaders course
Stars: ✭ 20 (-41.18%)
Mutual labels:  technical-analysis
AD Prediction
Alzheimer's Disease Prediction by using ResNet, AlexNet
Stars: ✭ 118 (+247.06%)
Mutual labels:  prediction
TreasuryFutureTrading
A statistical arbitrage strategy on treasury futures using mean-reversion property and meanwhile insensitive to the yield change
Stars: ✭ 40 (+17.65%)
Mutual labels:  trading-strategies
Base-On-Relation-Method-Extract-News-DA-RNN-Model-For-Stock-Prediction--Pytorch
基於關聯式新聞提取方法之雙階段注意力機制模型用於股票預測
Stars: ✭ 33 (-2.94%)
Mutual labels:  prediction

MSTA: Multi Strategy Trading Algorithm

Hybrid trading algorithm using a set of predictive methods to detect trends in market price time series. The set of predictions is then retreated through an ensemble method to provide a final prediction and a trading strategy is built on it.

Main guidelines: Why will the algo work?

Let us not forget how hard it is to predict asset returns. Here we will try to gain an edge over the market by cleverly combining different signals coming from different approaches. These approaches will come from two main different types of predictive algorithm: Technical analysis and Machine Learning. It is very important to have a set of classic algo trading strats well calibrated to begin with. Indeed, the ML algos can only provide an edge if we use them with the right calibration approach, but it is a mistake to believe they can learn everything by themselves if they don’t have the right dataset, hence we need to be very careful about how we will treat the results of these algos. A clever approach for example would be to use data science methods to tune hyperparameters of classic trading strats. We should also investigate the stock return patterns such as short term mean momentum, medium term mean reverting, and calendar anomalies.

Data

Working on the dataset is very important, please do not forget that whichever algo we use, we cannot create new information, only try to describe it. Currently we are using Quandl as data source. We could later use an API stream to build live dataset.

Here is the type of data we could include, in order of estimated importance:

  • Price data (Close for daily, and Bid/Ask for Intraday)
  • Traded Volume
  • News Data (please see the part about news analysis for more details)
  • Global Economic Data (CPI, GDP Growth, Interest Rates, ...)
  • Single Stock Data (see paper)
  • For other ideas, check the papers

Note that on the main reference and the second paper they transform an inomogeneous timestamp price dataset into a more simple time series containing only trend information, this approach could be very interesting but we would first need to check if this can be done IS consistently.

Description of the strategy

Multi algo approach where a core algorithm uses a set of predictions given by a selection of predictive models to give a global answer.

Global hyperparameters:

  • n: numbers of total obs
  • h: time between two obs, crucial:
    • we will begin with one day and then test with intraday data
  • X: main dataset
  • Y: return to predict data
  • Prediction type:
  • A binary output: Up/Down
  • A three class output: Up/Down/Neutral given a symetric threshold
  • A regression output

Core algorithm

Ensemble method. Basic prediction problem: predict a Y given a X. We can give him more data than the outputs, especially data helping him to understand the different inputs he has. Aim: Make sure the core algo always out perform all the single algos.

First approaches:

  • Pick best one out of a sample of obs
  • Equally weighted average
  • Manually fix the weights, allow for single algo testing

More advanced:

  • Use any one of the algos as a the core algo
  • Boosting algo methodology (for ex: AdaBoost):
    • on a linear reg w/out regularization
    • other base estimators
  • Voting methodology :
    • Majority Vote
    • Weighted Majority Vote
    • Borda Count
    • Weighted Borda Count
    • Bayesian Formalism
    • BKS
    • Dempster–Shafer theories of evidence
  • ESN: Echo State Network, see ref paper
  • Markov Network

Algos

All the algo needs to have a similar structure, hence we will build a general abstract class algo with the following attributes:

  • Predict function: function that gives a Y_test given a X_test
  • Select data function: manual or algorithmic way to select variables from the main dataset
  • Calib function: function that will train and calibrate the model on a Y_train and X_train subsets of obs. It will include the calibration of hyperparameters (check bellow)

The algos will be coded as subclass of the generic algo class, with overloaded methods. Here are a sample of possible algos:

  • Technical Analysis: cf ref for details

    • Historical Mean: arithmetic and geometric
    • Golden Cross / Dead Cross
    • MA enveloppe
    • RSI: Relative Strengh Index + Slopes
    • ROC: Rate of Change system
    • PSY: Psycological Stability
    • MOM: Momentum
    • VR: Volume Ratio
    • OBV: On Balance Volume
    • DIS: Disparity
    • STOD: Stochastic Indicator
    • CCI: Commodity Chanel Index
    • EVM: Ease of Movement
    • Force Index
    • Candle Chart Indicators:
      • Hammer and hanging man
      • Dark Cloud River
      • Piercing line
      • Engulginf pattern
  • Machine Learning:

    • Random Forest
    • SVM: Support Vector Machine
    • RVM: Relevance Vector Machine
    • Neural Networks:
      • MLP: Multi Layer Perceptrons, including Deep Learning methods
      • RNN: Recurrent Neural Networks, LSM: Liquid State Machines, ESN: Echo State Networks
      • GAN: Generative Adversarial Networks, can be used in RNN, including conditional GAN
      • DBN: Deep Belief Networks
    • Logit with/out regularization (LASSO, Ridge, Elastic Net)
    • Linear reg with/out regularization
    • Pairs Trading, or other correlation methods, can be coupled with cointegration testing modeling
    • Web scrapping (on news websites like FXstreet or ForexFactory)
    • Mean revert/trend follow on news impact
    • Adaptive boosting, and other boosting algos, used on several base estimators
    • K mean clustering
    • KNN
    • Bayesian network
    • Kalman Filter

These algos will have to be independently calibrated using one of these methods:

  • Time series expanding/rolling window cross validation:
    • Grid Search: brute forcing a set of hyperparams
    • Random Search: similar with a random subset of all combinaison
  • GA: Genetic Algorithm, see ref for details

Possible improvment: News Analysis

If implementing news analysis by itself as one of the algo is possible, news analysis can also be used in the trading strategy to avoid taking position close to big news event. As a result, including news into the model can have a range of impacts that could sensibly change the final performance of the stategy. Including a robust News Analysis tool is a key to generate consistent Alpha. There is two main ways to approach this problem, either use NLP to generate personalized data or directly use an already made database.

Please check these databases:

  • Accern Alphaone News Sentiment
  • Sentdex Sentiment Analysis
  • EventVestor
  • Raventpack

Trading Strategy

Out of our predictions we built a trading strat based on:

  • The final prediction
  • The variance of the predictions
  • Other indicators?

The basic idea is to go long/short when we predict a significant move with consistency across the models.

In case of a regression approach: to calculate the consistency we can assume a N(0,1) (or estimate a distribution via NP estimation) on Pred/std(Pred) and test his significativity at several thresholds. We could then invest only if the prediction is statistically different from zero.

In a case of classification approach: we can use the third prediction class Null to avoid too weak signals. This would be directed by an hyperparameter that can be estimated using an historical vol approach (GARCH?).

We could invest with a size inversely proportional to the variance, to define the exact optimal functional form of the size as a function of the prediction and its variance, we would need to solve an easy optimization problem on the PnL.

To conclude it would be interesing to code it using an set of input risk criterias, and let the algo optimize the trading strategy as a result.

Trading

We can trade using these following ways:

  • Quantopian: this option might be complicated given the size of the code and the external libraries used, however we mighe be able to import external files such as a trading log and use it in the Quantopian environment.
  • Zipline: a python library developped by quantopian for algo trading allowing to backtest and run algorithm, it seems to include part of quantopian data and Quantdl data
  • IG: online broker providing a trading and date stream API
  • IB: InteractiveBrokers, similar to IG

In order to comunicate with the trading API we might need to code in another language such as C++, or use HTTP protocols.

References & useful links

Please note than when only the name of the paper is given, you can find it on the IC Library Search tool.

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].