This code base is using the Julia Language to make a reproducible project named
CryptoTimeSeries
It is authored by tcae.
To (locally) reproduce this project, do the following:
-
Download this code base. Notice that raw data are typically not included in the git-history and may need to be downloaded independently.
-
Open a Julia console and do:
julia> using Pkg julia> Pkg.activate("path/to/this/project") julia> Pkg.instantiate()
This will install all necessary packages for you to be able to run the scripts and everything should work out of the box.
This is a playground Machine Learning project that aims to predict the best trades using popular cryptocurrencies on Binance.
Be cautious and don't use it for real trading unless you know what to do. There is no backward compatibility intention, restructuring of project parts may happen without announcement. Any trade signal from this software is no recommendation to trade. Trading cryptocurrencies is high risk.
Each module is located in the src folder and has a corresponding '_test' unti test in the test folder.
- The main module is Trade that is setup via trade_test, which runs a tradeloop but applies TradingStrategy to determine buy and sell actions
- Machine learning is made available by Classify.
- Targets provides target labels to train, evaluate and test machine learning approaches.
- Features provides OHLCV derived features as input for machine learning and trading.
- Ohlcv provides means to get locally stored historic Open High Low Close Volume data.
- CryptoXch is the abstract layer to Bybit
- Assets is selecting those assets from the exchange that are compliant to certain criteria that makes them a trading candidate.
- EnvConfig provides common configuratioin items, like the set of cryptos to use or common folders
- TestOhlcv provides periodic OHLCV patterns to test implementations.
Scripts for investigations as well as the GUI (cryptocockpit) are located in the scripts folder without a unit test
In order to achieve a seperation of concerns and a self documenting code, the approach is to separate
- the environment configuration EnvConfig
- the used OHLCV data Ohlcv and TestOhlcv
- the split into evaluation, test, and training data
- the features derived from OHLCV data Features
- the machine learning targets Targets
- the classification training and test Classify
- the management of assets through an exchage broker CryptoXch, Assets
- the trading strategy TradingStrategy
- the trading loop Trade and trade_test
In case of variants, e.g. features or classification algorithms, the same function name is implemented by different modules residing in the same , e.g. Features or Classify, package and have to imported via the package name using Features.Feature100
.
- simplegainperformance nbestgradientgain
- targets
- notes
- Trade/preparetradecache! should use Assets.jl instead of creating it's own asset selection
- create tar file of ohlcv files from ~/crypto/Features:
- cd ~/crypto/Features
- tar -czvf ohlcv.tar.gz *.jdf
- or
- tar -czvf ohlcv.tar.gz ~/crypto/Features/*.jdf
- list files in tar file ohlcv.tar.gz:
- tar -ztvf ohlcv.tgz
- extract files from ohlcv.tar.gz to ~/crypto/Features:
- tar -xzvf ohlcv.tar.gz -C ~/crypto/Features
- split a big file into 1.5GB chunks
- split -b 700m ohlcv.tar.gz ohlcv.tar.gz.parts_
- creates:
- -rw-rw-r-- 1 tor tor 2955474895 jun 10 17:40 ohlcv.tar.gz
- -rw-rw-r-- 1 tor tor 1572864000 jun 10 17:43 ohlcv.tar.gz.parts_aa
- -rw-rw-r-- 1 tor tor 1382610895 jun 10 17:43 ohlcv.tar.gz.parts_ab
- combine split files
- cat ohlcv.tar.gz.parts_* > ohlcv.tar.gz