Skip to content

Multifunctional cryptocurrency trading bot

License

Notifications You must be signed in to change notification settings

DvvSmoz/TradingBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Trading Bot 🚀

GitHub stars GitHub forks GitHub license


Overview

The Crypto Trading Bot is an closed-source solution that empowers users to execute automated trading strategies across multiple exchanges. Whether you're looking to scalp small profits in volatile markets or implement long-term investment strategies, this bot has got you covered.

With its modular design, the bot can be easily extended with custom scripts written in Lua, indicators, and algorithms. It supports real-time data streaming, backtesting, and live trading, ensuring that your strategies are robust and profitable.


Features

  • Multi-Currency Support: Trade any cryptocurrency pair supported by your exchange.
  • Customizable Scripts (Lua): Write your own trading logic using Lua, a lightweight and efficient scripting language.
  • Advanced Configuration: Fine-tune every aspect of the bot, from risk management to order execution.
  • Real-Time Data Streaming: Stay updated with the latest market prices and trends.
  • Backtesting: Test your strategies on historical data before going live.
  • Alert Notifications: Get notified via email or Telegram about important events.
  • Risk Management: Set stop-loss, take-profit, and position sizing rules.
  • Cross-Platform Compatibility: Run the bot on Windows, macOS, or Linux.

Supported Exchanges

Our bot integrates seamlessly with the following exchanges:

  • Binance
  • Coinbase Pro
  • Kraken
  • Bitstamp
  • Huobi
  • OKEx
  • And more!

If your preferred exchange isn't listed, feel free to contribute by adding support for it!


Configuration Options

The bot offers a wide range of configuration options to suit your trading style. Below are some key settings:

Setting Description
trade_pairs List of cryptocurrency pairs to trade (e.g., BTC/USD, ETH/USDT).
strategy Select a built-in strategy or specify a custom script path.
risk_level Define your risk tolerance (low, medium, high).
order_size Specify the size of each trade in base currency.
stop_loss_percentage Set the percentage loss at which the bot will exit a position.
take_profit_percentage Define the profit target for exiting a position.
timeframe Choose the chart timeframe for analysis (e.g., 1m, 5m, 15m).

Example config.json:

{
  "trade_pairs": ["BTC/USD", "ETH/USDT"],
  "strategy": "scripts/momentum_trading.lua",
  "risk_level": "medium",
  "order_size": 0.01,
  "stop_loss_percentage": 2.5,
  "take_profit_percentage": 5.0,
  "timeframe": "15m"
}

Custom Scripting with Lua

One of the standout features of this bot is its ability to run custom scripts written in Lua. Lua is a lightweight and efficient scripting language that makes it easy to write complex trading strategies.

Example Script: Moving Average Crossover

Here's an example of a simple moving average crossover strategy written in Lua:

function moving_average_crossover(data)
    local short_ma = calculate_sma(data, 10)
    local long_ma = calculate_sma(data, 50)
    
    if short_ma[#short_ma] > long_ma[#long_ma] then
        return "buy"
    elseif short_ma[#short_ma] < long_ma[#long_ma] then
        return "sell"
    else
        return "hold"
    end
end

function calculate_sma(data, period)
    local sma = {}
    local sum = 0
    for i = 1, #data do
        sum = sum + data[i]
        if i >= period then
            table.insert(sma, sum / period)
            sum = sum - data[i - period + 1]
        end
    end
    return sma
end

Save this script as scripts/moving_average_crossover.lua and reference it in your config.json.


Performance Metrics

Monitor your bot's performance with detailed metrics and visualizations. The dashboard includes:

  • Profit & Loss (P&L) charts
  • Trade history
  • Win rate and average profit per trade
  • Risk-adjusted returns

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details.