- Notifications
You must be signed in to change notification settings - Fork2
haybb/WH-Bot
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A python trading bot.
This program aims totrade in all available markets 24/7 and can be used as a support for severalstrategies, time frames, pairs.Education purpose only, use it under your own risks.
Need few packages :pandas, numpy, mplfinance, schedule, yfinance, ccxt, datetime, time, warnings.To download them, open your command prompt, navigate to WH-Bot folder (after having downloaded this program),and type :pip install -r requirements.txt
or do it manually by typing :pip install package_name
(e.g.pip install pandas
)
Just have to launchWH-Bot.exe
.Or you can also executeMain.py
.
For the purpose of the script, we use a Simple Moving Average (SMA) strategy:go long when SMA > Previous SMA and go short when SMA < Previous SMA.Details inStrategy.py
.
First, need a backtest strategy in order to verify historical behaviour,refer toStrategy.py
andBacktest.py
files.Then, if validated enter in real time trading, refer toLive.py
file.
- Yahoo Finance: not required to login, simplest way and use by default in
Strategy.py
,only usable with historical strategy. - CCXT: requires broker account with API keys,only for advanced users,(the ones supported by ccxt are visiblehere)Use ccxt with
Live.py
, need data in real time (not available with Yahoo Finance).
When all above downloaded, executeMain.py
orWH-Bot.exe
.Script will execute backtest and will show strategy results :
- Net backtest period profit $
- Total % profit backtest period
- Number of winning and losing trades
- Commission paid
- Daily profit $
- Monthly profit %It also includes chart. It shows candlesticks with selected settings.
To modify the strategy, use your own applicable indicators and updateIndicators.py
accordingly.Then updateStrategy.py
with your own study.If everything's fine, updateLive.py
and you're ready to enter in the real trading world.