Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

SockTrader v1 Open Source Cryptocurrency Trading Bot


100%

Recommended Posts

  • Administrator

Overview

SockTrader is an open-source cryptocurrency trading bot that automates the buying and selling of cryptocurrencies based on strategies that you can program. These strategies consist of a set of rules that define when and how the bot should operate within the cryptocurrency market. You can base these rules on technical analysis or simply instruct the bot to execute trades at specific price levels. Ultimately, the decision-making framework is entirely up to you!

The name "SockTrader" reflects its websocket-based functionality, which allows for real-time connections to the exchange. This capability ensures that the bot can react swiftly to changes in the market with minimal latency.

Features

  • 🚀 Real-time, ultra-fast websocket trading.
  • 📈 Over 50 technical indicators available. (refer to documentation)
  • 🌈 Developed in TypeScript!
  • 🌿 Unit-tested source code.
  • 🔫 Mutation testing for enhanced testing quality.
  • 📝 Ability to run paper trading strategies using live exchange data.
  • 🏡 Comprehensive backtesting engine with local data.
  • ️ Test and live reload your strategies through our online dashboard!
  • 🚢 Option to run SockTrader within a Docker container.
  • More features to be added soon!

Online Dashboard

We've created an online dashboard that allows you to visually confirm all trades made during a backtesting session. It features a live reload functionality, meaning SockTrader will restart the current backtest whenever you modify and save your strategy code. All executed trades will be displayed on the chart, as illustrated in the provided screenshot.

To try it out yourself:

  1. Follow our Quick Start guide.
  2. Execute npm run web and keep all settings at default.
  3. Visit our online dashboard to test your strategies!

spacer.png

Quick Start Guide

Using Docker:

  1. Clone the repository locally:

     
  • git clone https://github.com/SockTrader/SockTrader
        
  • Add trading bot configuration:

     
  • cp src/config.ts.dist src/config.ts
        

    (Optional) Edit src/config.ts as needed.

  • Build the Docker image:

     
  • cd SockTrader && docker build -t socktrader .
        
  • Start the container:

     
  1. docker run socktrader --help
        

Using Local Scripts:

  1. Clone the repository locally:

     
  • git clone https://github.com/SockTrader/SockTrader
        
  • Install dependencies:

     
  • cd SockTrader && npm install
        
  • Create the trading bot configuration file:

     
  • cp src/config.ts.dist src/config.ts
        
  • Build the project:

     
  • npm run build
        
  • Normalize candle data (BTC/USD from Coinbase) from src/data to a readable format in build/data:

     
  • npm run normalize
        
  • Run SockTrader:

     
  1. This is the hidden content, please

     

Additional Scripts

  • npm run test: Run the Jest test suite.
  • npm run web-dev: Start a development web server with Nodemon for rapid and easy development.
  • npm run web: Start the web server, which can be used for "live reload" with websockets.
  • npm run socktrader -- backtest --candles=coinbase_btcusd_1h --strategy=simpleMovingAverage: Start a backtesting trading session.
  • npm run socktrader -- live --paper --pair btc usd --strategy simpleMovingAverage --exchange hitbtc --interval 1m: Start a paper trading session.

Advanced Features

You can load your own candle data for a trading pair of interest by following these steps:

  1. Download Raw Candles: Obtain raw candles from a trusted source in JSON or CSV format and place them in the src/data folder.

  2. Create a Candle Normalizer: This utility script is closely tied to a raw candle file, normalizing the data from a raw CSV or JSON file into a generic format in the build/data folder. You can trigger this normalization process by running:

     
  • npm run normalize
        
  • Expected Output of a Normalizer: The output should adhere to the IDataFrame interface from data-forge, with each row following this type definition:

     
  1. This is the hidden content, please

     

Example of a Candle Normalizer

Here’s a basic example that shows how to create your own candle normalizer. Make sure to save this file in the src/data folder alongside the raw candle files, preferably with the same name as the candle file but with a .ts extension.

 
This is the hidden content, please

Create Your Own Strategy

You can refer to the example strategy provided in this repository, named simpleMovingAverage, to help you create your own strategy.

Get Involved!

We welcome additional contributors to help elevate this project. Don’t hesitate to reach out to us on Telegram or Gitter.

Additionally, you can support us by:

  • Donating to cover hosting costs.
  • Funding advertisements on the SockTrader dashboard.
  • Sharing valuable insights with the community.

ROADMAP

Version 1.0:

  • Enhance communication between the dashboard and SockTrader.
  • Improve and update live trading capabilities.
  • Test edge cases (like rounding issues).
  • Evaluate altcoin trading and optimize as needed.
  • Implement basic backtest analyzers.
  • Introduce internationalization for the dashboard.
  • Refine dashboard architecture.
  • Increase test coverage and quality.
  • Expand documentation.

Future Plans:

  • Improve logging capabilities.
  • Add more exchanges.
  • Develop advanced backtest analyzers.
  • Display wallet status on the dashboard.
  • Show analyzer status on the dashboard.
  • And much more!

If you have great ideas for improvement, feel free to open a pull request!

DISCLAIMER

Using a trading bot does not guarantee profits. Additionally, trading cryptocurrencies involves high risk. Losses are possible, and SockTrader cannot be held responsible for them.


Feel free to adjust any sections further if necessary!

 

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

Spoiler

Author - cwouter

 

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...