Giter VIP home page Giter VIP logo

demo-python-trading-bot's Introduction

SimpleBot

SimpleBot is a Python bot implementing a scalping trading strategy. It can work with any assets pair on the Waves DEX.

SimpleBot exploits small changes in currency prices: it buys at the mean price minus some step and sells at the mean price plus some step, in order to gain the bid/ask difference. It normally involves establishing and liquidating a position quickly, in this case within 15 seconds.

The SimpleBot with initial parameters trade on Waves-BTC pair (Waves is an amount asset and BTC is a price_asset). The spread mean price is (best_bid + best_ask) / 2. The price step is 0.5% from mean price. The SimpleBot place the buy order at price meanprice * (1 - price_step) and the amount (BTC_balance / bid_price) - order_fee. The sell order is placed at meanprice * (1 + price_step) and the amount equal to Waves_balance - order_fee.

Installation

SimpleBot requires Python 3.x and the following Python packages:

You can install them with

pip install pywaves
pip install configparser 

Getting Started

You can start SimpleBot with this command:

python SimpleBot.py config.cfg

Configuration

Configuration file config.cfg have next set of parameters: node is the address of the fullnode

matcher is the matcher address

chain mainnet or testnet

order_fee is the fee to place buy and sell orders

order_lifetime is the maximum life time (in seconds) for an open order

private_key is the private key of the trading account

amount_asset and price_asset are the IDs of the traded assets pair

price_step is the step of scalping relative to the mean price (proportion)

demo-python-trading-bot's People

Contributors

gingerabsurdity avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.