Join My public Discord Server & Follow The Twitter
- Comes with 11 pre-built strategies found in TradingStrats.py
- See Documentation below to implement your TA strategies. (currently working on new documentation)
- If you enjoy the repo please share it around to friends & tweet about it using the tweet button above ๐
or Buy me a Coffee
- python-Binance Client to execute orders and pull data from Binance
- ta library for Technical indicators
- plotly for generating interactive Trade graphs.
- tabulate for logging trades in a table format
- colorlog for adding colour to logs
Set up windows to sync time once a day if you don't do this binance will eventually reject orders with a timestamp error.
Strategies are implemented in TradingStrats.py as functions and then referenced in Bot_Class.Bot.make_decision()
Make_decision()
must returnTrade_Direction, stop_loss_val, take_profit_val
for the strategy to work properly- You might draw inspiration for a strategy from one of the samples in TradingStrats.py
Docs are being updated currently for the new bot
Create Custom Strategies
Create Custom TP/SL functions
- Create a Binance Account (This link uses my referral which gives you 5% kickback on trades & would be greatly appreciated)
- Enable Two-factor Authentication in the security section to keep your crypto safe.
- Create a new API key under the API Management section.
- [โ] Read Info [โ] Enable Trading [โ] Enable Futures [X] Enable Withdrawals
- Fill in your api keys into api_secret and api_key in live_trading_config.py
Run strategies at your own risk I am not responsible for your trading decisions, futures are risky and proper risk management should be adhered to at all times, always have a stoploss
python3 live_trading.py
- Trade a single position at a time by setting
max_number_of_positions = 1
, to trade multiple coins just increment this value. leverage
andorder_size
should be changed according to your preferencesymbols_to_trade[]
is a list of the symbols you wish to trade, If you wish to trade all symbols settrade_all_symbols = True
.- Trailing stop: set
use_trailing_stop = True
and changetrailing_stop_callback
to suit your strategy to use the trailing stop (Min val .001 i.e .1%, Max 5 i.e. 5%). The trailing stop will be placed when the take profit value margin of increase/decrease is reached from your strategy. - To close a trade based off a condition check_close_pos() must return a close_pos flag. (Not functioning currently, this needs updated for new bot)
trading_strategy
is the name of the strategy you want to use, see below for adding your own custom strategies.- There are 11 default strategies to choose from:
StochRSIMACD, tripleEMAStochasticRSIATR, tripleEMA, breakout, stochBB, goldenCross, candle_wick, fibMACD, EMA_cross, heikin_ashi_ema2 & heikin_ashi_ema
- TP_SL_choice is the type of take profit and stop loss you want to use valid choices are:
USDT, %, x (ATR), x (Swing High/Low) level 1, x (Swing High/Low) level 2, x (Swing High/Low) level 3, x (Swing Close) level 1, x (Swing Close) level 2, x (Swing Close) level 3
SL_mult
andTP_mult
are multipliers for theTP_SL_choice
Example:
TP_SL_choice = 'USDT'
SL_mult = 1
TP_mult = 2
This configuration will set TP and SL values at $1 loss and $2 gain respectively- Choose the
interval
you want to trade, valid intervals are:1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d
.
Quantopian Lectures | Silicon Trader | Trade Pro | Strategy Testing | Trading Journal | The Moving Average
- Prioritise your Trello ticket with a one time payment
- Get Custom Strategies made to your specifications by reaching out to me on discord for a quote price.
- If you have any queries about anything, or need me to explain any blocks of code please reach out to me on Discord.
- If you have any suggestions or requests please reach out to me as well. Join My public Discord Server & Follow The Twitter