Giter VIP home page Giter VIP logo

novacer / alpharithmic-trading Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 15.0 118.76 MB

Backtest your trading strategy at a click of a button! How much alpha can you generate?

Home Page: http://alpharithmic.herokuapp.com

License: MIT License

Python 67.60% JavaScript 0.93% TypeScript 27.82% CSS 3.14% Shell 0.52%
algorithmic-trading python machine-learning finance angular stocks stock-price-prediction stock-market

alpharithmic-trading's Introduction

Alpharithmic Trading

Backtest your trading strategy at a click of a button! How much alpha can you generate?

In case you haven't noticed yet, we are LIVE at http://alpharithmic.herokuapp.com. More exciting features to come!

Technologies used in this project:

  • Python Django REST Framework

    • Zipline Live Trading Engine
    • Django Channels
    • Daphne
    • Asynchronous Server Gateway Interface (ASGI)
    • Redis Job Queue
    • Websockets
    • Numpy
    • Matplotlib
    • Scikit-learn (Machine Learning)
    • Pandas
    • REST API
  • Angular 6

    • Angular Material
    • Bootstrap
    • Chartjs

    Introduction

    This web application provides hyper-realistic and interactive simulations for trading algorithms.

    With a philosophy that "seeing is believing", every transaction, calculation, and event is logged live as the algorithm runs. This provides a superior user experience because the user can literally see the algorithm in action, allowing for a greater understanding of the algorithm's behaviour, strengths, and weaknesses.

    The main driver behind this magic comes from the Zipline Live Trading Engine developed by Quantopian, an educational platform for learning quantitative finance. Some of the algorithms found on this site are inspired by the research efforts and journals shared by the community of Quantopian.

    The stock pricing data is sourced from the Quandl WIKI API, which is available for free for anyone with a Quandl account.

    Build Your Own Algorithm

    WIP! Try out what's working so far! Demo

    The Three Types of Trading Algorithms

    The example algorithms that can be found on this site are divided into three main categories (or classes).

    The Naive Class

    The Naive Class of algorithms is a class categorized by the fact that they track and trade a single stock using some strategy. You can tell if an algorithm falls under the Naive Class if you have to pick a stock to trade in the simulation parameters. Conceptually,these are the easiest algorithms to understand. However, simple does not mean it's ineffective! There are tons of great strategies that fall under this category. For starters, we recommend checking out the RSI Divergence Strategy!

    The Advanced Class

    The Advanced Class of algorithms differs from the Naive Class in that you do not get to pick a stock! Instead, the Advanced Class will scan the market to identify the best combination of stocks to long/short in your portfolio to maximize your return. These algorithms leverage the Pipeline API provided by Zipline, which provides a series of filters and sorts to identify the strongest stocks based on some quantitative factor. For a great demonstration of this, try out the Trend Follower Algorithm!

    The Machine Learning Class

    This is a special class of algorithms that specifically integrate machine learning classifiers and capabilities to derive a set of insights that the above two classes cannot. Here's a great example using a Random Forest Regressor Algorithm!

Diagrams

alpha arch

alpharithmic-trading's People

Contributors

novacer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alpharithmic-trading's Issues

Redis causing memory leak

It appears that the redis in memory database is causing a memory leak due to jobs not being deleted after they finish running in the queue. Will need to update the code sometime soon to resolve this issue, though it is not a big priority.

All algorithms are failing because IEX API has been deprecated

Zipline uses IEX API to fetch benchmark data for SP 500. Unfortunately since June 15 this API was deprecated. Thus running any algorithm, including the simple validation algorithm will fail without recovery.

Possible fixes include caching a version of the benchmark data locally instead of performing API call. Else, modify the code to get benchmark data from another source, like yahoo.

Either way would require modifying Zipline API source code which is not the best solution.

Validation for ticker symbols

  • There needs to be a way to validate whether we have certain stock ticker symbols in the database.
  • Currently if a symbol is not found, the API will throw an error.
  • There should be a dedicated endpoint to validate if an entered ticker is in our database or not.

Regimes Clustering: Using random forest classifier causes job to fail

  • doesn't seem to be an issue when running locally
  • random forest regression seems to run fine.
  • on heroku, choosing to run regimes while selecting the random forest classifier for periods around 6 months or more seems to cause the job to fail sometimes. The confusing part is that sometimes it works and sometimes it doesn't, even when the simulation params remains the same.
  • this suggests its possibly a redis issue?
  • will investigate further, and if I can figure out what the heck is going on I'll document it here.

Linux Ver. of Python does not support Tkinter

When deploying to heroku, the backend breaks because all of the APIs require matplotlib, which by default uses tkinter. However, the linux ver of python does not include this package.

new

My name is Luis, I'm a big-data machine-learning developer, I'm a fan of your work, and I usually check your updates.

I was afraid that my savings would be eaten by inflation. I have created a powerful tool that based on past technical patterns (volatility, moving averages, statistics, trends, candlesticks, support and resistance, stock index indicators).
All the ones you know (RSI, MACD, STOCH, Bolinger Bands, SMA, DEMARK, Japanese candlesticks, ichimoku, fibonacci, williansR, balance of power, murrey math, etc) and more than 200 others.

The tool creates prediction models of correct trading points (buy signal and sell signal, every stock is good traded in time and direction).
For this I have used big data tools like pandas python, stock market libraries like: tablib, TAcharts ,pandas_ta... For data collection and calculation.
And powerful machine-learning libraries such as: Sklearn.RandomForest , Sklearn.GradientBoosting, XGBoost, Google TensorFlow and Google TensorFlow LSTM.

With the models trained with the selection of the best technical indicators, the tool is able to predict trading points (where to buy, where to sell) and send real-time alerts to Telegram or Mail. The points are calculated based on the learning of the correct trading points of the last 2 years (including the change to bear market after the rate hike).

I think it could be useful to you, to improve, I would like to share it with you, and if you are interested in improving and collaborating I am also willing, and if not file it in the box.

Rewrite log server as async

It's become clear that with the newest introduction of the RSI Divergence Strategy in #33 that the current synchronous implementation of the logging tends to use too much resources.

The proposed solution is to rewrite the server to be async. Also, the number of repetitive logs for RSI could be cleaned up as well.

Matplotlib plots are not clearing after each API use.

When an API is called it appears that the result is saved into the pyplot object as a figure, but when the API is called again, the new figure becomes appended to the old figure. The expected behaviour should be that a completely new set of plots and figures are generated, with the old ones being deleted once the API finishes responding.

Heroku has a hard coded API response timeout of 30s.

Many of the APIs require longer than 30s to complete. However, heroku will kill the connection after 30s (even though the websocket continues to be pushed). Thus it will be necessary to learn how to fix this issue either through websockets or through some type of background queuing system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.