Git Product home page Git Product logo

zvezdin-py's Introduction

Trading Platform

In general

The platform is supposed for backtesting and running trading strategies.

Configuring a strategy

First create global config:

cp config.example.yml config.yml

Strategies are located in strategy/ dir. There are some built-in strategies:

  • buy-and-hold strategy. Can be configured to sell and hold also.
  • levels-v1. Calculates price levels and makes trade when price jumps off the level.

Example config included for each strategy. See config.example.yml. To run strategy you need to create actual config:

cd strategy/<name>
cp config.example.yml config.yml

Commands

Download Binance kline (candle) data for given ticker and date:

./binance-download.sh BTCBUSD-5m-2022-02-26

Kline data is downloaded into market_data/ folder.

Run backtests for a strategy:

python app.py backtest --strategy buy-and-hold --from 2022-02-18 --to 2022-02-26

Run backtests with a custom window size:

python app.py backtest --strategy levels-v1 --from 2022-02-18 --to 2022-02-26 --window 100

Development

Running tests

pytest .

For visualization purposes some xlsx charts are located in test_data/levels. There are price charts for small periods of time. Those charts help to understand existing tests and write new ones. Files are named the same as tests.

Note. The price in market_data/*.csv files may be a little different from the price you see on exchanges.

zvezdin-py's People

Contributors

big-striped-cat avatar

Watchers

 avatar

zvezdin-py's Issues

ValueError: max() arg is an empty sequence

Hey,
thanks for this helpful project,

I'm wondering about the results (losses/profits ..) can you share your experince with this project,
and let me know if you are still working on this project?

Waiting for your feedback

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.