Skip to content

ADanciulescu/Midas

Repository files navigation

Midas

Project Goal:

  1. Use a bot to put into practice a cryptotrading strategy that consistently outperforms market.

Project Functions:

  1. Historical data fetching from Poloniex cryptotrading exchange
  2. Backtesting trading strategies against historical data.
  3. Live application of strategies on the exchange.

Project Structure:

1. ./Models/ Contains definitions of self contained packages of data which are stored on persistent storage(sqlite).
Models provide a standardized interface between the data in db and the code using the data.
Meaning, when data is fetched, it is assembled into a corresponding model and saved to db.
Likewise, data is retrieved from db in the form of objects of the corresponding model type. Examples:
Candle: A candle object stores all the fields used to define a candlestick --a snapshot of the price during a x minute trading window--
Trend: A trend object stores data pertaining to a google trend snapshot for a given currency
...
  1. ./data_fetchers/ Code used to fetch data from without. Data is converted into models and saved to db. candle_fetcher fetches candle stick data from polo.
    trend_fetcher fetches trend data from google.
    trade_fetcher fetches users trading history.
    ...

  2. ./data_parsers/ Converts raw API data into standards defined in Models

  3. ./exchange_clients/ Interface used by bot to actively trade on exchange. Note Bitfinex client is not finished.

  4. ./point_creators/ Sometimes, the implementation of various TA techniques required the computation of intermediary data points.
    For example, points corresponding to moving averages. ./point_creators/ stores code for computing these intermediary points which are converted
    to Point model and stored persistently in db.

  5. ./r_scripts/ Stores some R code, that I used to visualize and mess around with data.

  6. ./scripts/ misc scripts used to synch up remote server db with local, etc.

  7. ./simulation. Main file is trade_simulator.py. If specific trading strategies are like game cartridges, trade_simulator is like the nintendo console.
    Takes as input a trading strategy and historical data of a currency and simulates trading based on that strategy. Output is the performance.
    Contains some other code as well for modifying parameters of strategies and logging results in db.

  8. ./strategies/ Contains the implementation of various strategies. Main method of each strategy is decide which given a specific point in time will decide whether to buy or sell. Each strategy should be compatile with both the exchange code that buys/sells live, and the simulator code.

  9. ./trade/ Code rand on remote server used to perform live trades on the exchange. Makes use of a specific strategies to decide when to buy/sell.

  10. ./tools/ misc stuff, hard coded table names, random general purpose code.

TODO:

1. Backtest my old strategies to see if they holdup in light of a whole bunch of new data.
  1. Work on half-done parallel project called Argos that uses js to visualize trades.
    This should give insight into the shortcomings of backtesting as a whole as well as where specific strategies go wrong.

  2. Come up with new strategies. General af but I got some ideas.

  3. Add different exchange clients other than poloniex since others may have advatanges such as lower fees/

  4. Look into possibility for arbitrage between exchanges.

How to run:

Fetch Data:

python3 pull_data.py --ticker BTC --start_date 2019-1-1 --resolution 300

Backtest Strategy against existing data:

python3 backtest.py --strategy BollingerStrategy --ticker BTC --start_date 2019-06-01 --resolution 300 --num_days 100

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages