Skip to content

ballenaeth/quick_trade

 
 

Repository files navigation

quick_trade

VIEW DOCUMENTATION: https://vladkochetov007.github.io/quick_trade.github.io

P.S.: documentation now in v3.0

image

used:
 ├──ta by Darío López Padial (Bukosabino   https://github.com/bukosabino/ta)
 ├──tensorflow (https://github.com/tensorflow/tensorflow)
 ├──pykalman (https://github.com/pykalman/pykalman)
 ├──plotly (https://github.com/plotly/plotly.py)
 ├──scipy (https://github.com/scipy/scipy)
 ├──pandas (https://github.com/pandas-dev/pandas)
 ├──numpy (https://github.com/numpy/numpy)
 ├──itertools
 ├──datetime
 ├──python-binance
 └──iexfinance (https://github.com/addisonlynch/iexfinance)

Algo-trading system with python.

customize your strategy!

import quick_trade.trading_sys as qtr
from quick_trade import brokers
import yfinance as yf

class My_trader(qtr.Trader):
    def strategy_sell_and_hold(self):
        ret = []
        for i in self.df['Close'].values:
            ret.append(qtr.utils.SELL)
        self.returns = ret
        self.set_credit_leverages(1.0)
        self.set_open_stop_and_take()
        return ret


a = My_trader('MSFT', df=yf.download('MSFT', start='2019-01-01'))
a.set_pyplot()
a.set_client(brokers.BinanceTradingClient())
a.strategy_sell_and_hold()
a.backtest()

installing:

$ git clone https://github.com/VladKochetov007/quick_trade.git
$ pip3 install -r quick_trade/requirements.txt

or

$ pip3 install quick-trade

user_code example:

import quick_trade.trading_sys as qtr
import yfinance as yf


df = yf.download(tickers='XRP-USD', period='5d', interval='1m')
trader = qtr.Trader('XRP-USD', df=df, interval='1m')
trader.set_client(qtr.TradingClient())
trader.set_pyplot()
trader.strategy_parabolic_SAR()
trader.set_credit_leverages(1)
trader.backtest(commission=0.075)

output plotly chart:

image

output print

losses: 226
trades: 460
profits: 232
mean year percentage profit: 9075.656014641549%
winrate: 50.43478260869565%

image

Help the project

BTC: 15TC5wjgxTj5btKr75DBswsdafUqXmkAjp

ETH ERC20: 0xbc7d8d7fb6ccc0963a7bf5eb41faf8e4bb546740

USDT TRC20: TCb9nWdApXmrfQuPcChdP9FpBXjXuFDFNX

License

Creative Commons License
quick_trade by Vlad Kochetov is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Based on a work at https://github.com/VladKochetov007/quick_trade.
Permissions beyond the scope of this license may be available at vladyslavdrrragonkoch@gmail.com.

Packages

No packages published

Languages

  • Python 100.0%