Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A python trading bot.

License

NotificationsYou must be signed in to change notification settings

haybb/WH-Bot

Repository files navigation

A python trading bot.

Goal

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.

For running the script

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.txtor do it manually by typing :pip install package_name (e.g.pip install pandas)

Execution

Just have to launchWH-Bot.exe.Or you can also executeMain.py.

Screen

Strategy

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.

Functioning

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.

To get input trading data

  • Yahoo Finance: not required to login, simplest way and use by default inStrategy.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 withLive.py, need data in real time (not available with Yahoo Finance).

Execution

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.

Feel free to contribute

Enjoy!


[8]ページ先頭

©2009-2025 Movatter.jp