From 17ca217011e038e24aa6d1bbfb0c0dddf3635603 Mon Sep 17 00:00:00 2001 From: rainfu Date: Wed, 31 May 2023 08:27:32 +0000 Subject: [PATCH] deploy: f6e7badc763069f787f26efa786d9c3a5e255b52 --- 404.html | 2 +- README.html | 6 +++--- api.html | 6 +++--- assets/{README.md.774d846d.js => README.md.2de6eb80.js} | 2 +- ...EADME.md.774d846d.lean.js => README.md.2de6eb80.lean.js} | 2 +- assets/{api.md.5bcff37c.js => api.md.1ad43746.js} | 2 +- assets/{api.md.5bcff37c.lean.js => api.md.1ad43746.lean.js} | 2 +- assets/{config.md.24bf3995.js => config.md.87c1437e.js} | 2 +- ...onfig.md.24bf3995.lean.js => config.md.87c1437e.lean.js} | 2 +- .../{developer.md.f736e55d.js => developer.md.bf9c8192.js} | 2 +- ...er.md.f736e55d.lean.js => developer.md.bf9c8192.lean.js} | 2 +- assets/{exchange.md.368a3ea4.js => exchange.md.1a30b858.js} | 2 +- ...nge.md.368a3ea4.lean.js => exchange.md.1a30b858.lean.js} | 2 +- assets/{faq.md.bd3b202b.js => faq.md.6a07f812.js} | 2 +- assets/{faq.md.bd3b202b.lean.js => faq.md.6a07f812.lean.js} | 2 +- assets/{index.md.1c1c2e14.js => index.md.4bd7b1ab.js} | 2 +- ...{index.md.1c1c2e14.lean.js => index.md.4bd7b1ab.lean.js} | 2 +- assets/{pm2.md.900932fa.js => pm2.md.3c6fe67c.js} | 2 +- assets/{pm2.md.900932fa.lean.js => pm2.md.3c6fe67c.lean.js} | 2 +- assets/{start.md.c4781097.js => start.md.3c3bf4c4.js} | 2 +- ...{start.md.c4781097.lean.js => start.md.3c3bf4c4.lean.js} | 2 +- assets/{strategy.md.d3fef1f4.js => strategy.md.e8847b69.js} | 2 +- ...egy.md.d3fef1f4.lean.js => strategy.md.e8847b69.lean.js} | 2 +- .../{zh_README.md.1b2c4e67.js => zh_README.md.0a0a0a63.js} | 2 +- ...ME.md.1b2c4e67.lean.js => zh_README.md.0a0a0a63.lean.js} | 2 +- assets/{zh_api.md.9b1e7d12.js => zh_api.md.4eb83246.js} | 2 +- ...h_api.md.9b1e7d12.lean.js => zh_api.md.4eb83246.lean.js} | 2 +- .../{zh_config.md.2cb97454.js => zh_config.md.4db86f5f.js} | 2 +- ...ig.md.2cb97454.lean.js => zh_config.md.4db86f5f.lean.js} | 2 +- ...developer.md.1b57898c.js => zh_developer.md.135362c9.js} | 2 +- ...md.1b57898c.lean.js => zh_developer.md.135362c9.lean.js} | 2 +- ...h_exchange.md.0c7cc145.js => zh_exchange.md.60d49648.js} | 2 +- ....md.0c7cc145.lean.js => zh_exchange.md.60d49648.lean.js} | 2 +- assets/{zh_faq.md.b5c01c15.js => zh_faq.md.38706051.js} | 2 +- ...h_faq.md.b5c01c15.lean.js => zh_faq.md.38706051.lean.js} | 2 +- assets/{zh_index.md.e44a0a62.js => zh_index.md.e01e624f.js} | 2 +- ...dex.md.e44a0a62.lean.js => zh_index.md.e01e624f.lean.js} | 2 +- assets/{zh_pm2.md.7bb1c756.js => zh_pm2.md.3c4bfefd.js} | 2 +- ...h_pm2.md.7bb1c756.lean.js => zh_pm2.md.3c4bfefd.lean.js} | 2 +- assets/{zh_start.md.eca26e77.js => zh_start.md.7236027f.js} | 2 +- ...art.md.eca26e77.lean.js => zh_start.md.7236027f.lean.js} | 2 +- ...h_strategy.md.c37ef5d2.js => zh_strategy.md.242ac32d.js} | 2 +- ....md.c37ef5d2.lean.js => zh_strategy.md.242ac32d.lean.js} | 2 +- config.html | 6 +++--- developer.html | 6 +++--- exchange.html | 6 +++--- faq.html | 6 +++--- hashmap.json | 2 +- index.html | 4 ++-- pm2.html | 6 +++--- start.html | 6 +++--- strategy.html | 6 +++--- zh/README.html | 6 +++--- zh/api.html | 6 +++--- zh/config.html | 6 +++--- zh/developer.html | 6 +++--- zh/exchange.html | 6 +++--- zh/faq.html | 6 +++--- zh/index.html | 4 ++-- zh/pm2.html | 6 +++--- zh/start.html | 6 +++--- zh/strategy.html | 6 +++--- 62 files changed, 100 insertions(+), 100 deletions(-) rename assets/{README.md.774d846d.js => README.md.2de6eb80.js} (93%) rename assets/{README.md.774d846d.lean.js => README.md.2de6eb80.lean.js} (82%) rename assets/{api.md.5bcff37c.js => api.md.1ad43746.js} (96%) rename assets/{api.md.5bcff37c.lean.js => api.md.1ad43746.lean.js} (82%) rename assets/{config.md.24bf3995.js => config.md.87c1437e.js} (99%) rename assets/{config.md.24bf3995.lean.js => config.md.87c1437e.lean.js} (83%) rename assets/{developer.md.f736e55d.js => developer.md.bf9c8192.js} (98%) rename assets/{developer.md.f736e55d.lean.js => developer.md.bf9c8192.lean.js} (83%) rename assets/{exchange.md.368a3ea4.js => exchange.md.1a30b858.js} (99%) rename assets/{exchange.md.368a3ea4.lean.js => exchange.md.1a30b858.lean.js} (82%) rename assets/{faq.md.bd3b202b.js => faq.md.6a07f812.js} (98%) rename assets/{faq.md.bd3b202b.lean.js => faq.md.6a07f812.lean.js} (82%) rename assets/{index.md.1c1c2e14.js => index.md.4bd7b1ab.js} (96%) rename assets/{index.md.1c1c2e14.lean.js => index.md.4bd7b1ab.lean.js} (96%) rename assets/{pm2.md.900932fa.js => pm2.md.3c6fe67c.js} (99%) rename assets/{pm2.md.900932fa.lean.js => pm2.md.3c6fe67c.lean.js} (83%) rename assets/{start.md.c4781097.js => start.md.3c3bf4c4.js} (99%) rename assets/{start.md.c4781097.lean.js => start.md.3c3bf4c4.lean.js} (82%) rename assets/{strategy.md.d3fef1f4.js => strategy.md.e8847b69.js} (99%) rename assets/{strategy.md.d3fef1f4.lean.js => strategy.md.e8847b69.lean.js} (82%) rename assets/{zh_README.md.1b2c4e67.js => zh_README.md.0a0a0a63.js} (93%) rename assets/{zh_README.md.1b2c4e67.lean.js => zh_README.md.0a0a0a63.lean.js} (83%) rename assets/{zh_api.md.9b1e7d12.js => zh_api.md.4eb83246.js} (95%) rename assets/{zh_api.md.9b1e7d12.lean.js => zh_api.md.4eb83246.lean.js} (82%) rename assets/{zh_config.md.2cb97454.js => zh_config.md.4db86f5f.js} (99%) rename assets/{zh_config.md.2cb97454.lean.js => zh_config.md.4db86f5f.lean.js} (82%) rename assets/{zh_developer.md.1b57898c.js => zh_developer.md.135362c9.js} (97%) rename assets/{zh_developer.md.1b57898c.lean.js => zh_developer.md.135362c9.lean.js} (83%) rename assets/{zh_exchange.md.0c7cc145.js => zh_exchange.md.60d49648.js} (99%) rename assets/{zh_exchange.md.0c7cc145.lean.js => zh_exchange.md.60d49648.lean.js} (83%) rename assets/{zh_faq.md.b5c01c15.js => zh_faq.md.38706051.js} (98%) rename assets/{zh_faq.md.b5c01c15.lean.js => zh_faq.md.38706051.lean.js} (82%) rename assets/{zh_index.md.e44a0a62.js => zh_index.md.e01e624f.js} (96%) rename assets/{zh_index.md.e44a0a62.lean.js => zh_index.md.e01e624f.lean.js} (96%) rename assets/{zh_pm2.md.7bb1c756.js => zh_pm2.md.3c4bfefd.js} (99%) rename assets/{zh_pm2.md.7bb1c756.lean.js => zh_pm2.md.3c4bfefd.lean.js} (83%) rename assets/{zh_start.md.eca26e77.js => zh_start.md.7236027f.js} (99%) rename assets/{zh_start.md.eca26e77.lean.js => zh_start.md.7236027f.lean.js} (83%) rename assets/{zh_strategy.md.c37ef5d2.js => zh_strategy.md.242ac32d.js} (99%) rename assets/{zh_strategy.md.c37ef5d2.lean.js => zh_strategy.md.242ac32d.lean.js} (83%) diff --git a/404.html b/404.html index a0bbf07..ac90a29 100644 --- a/404.html +++ b/404.html @@ -12,7 +12,7 @@
Skip to content

404

PAGE NOT FOUND

But if you don't change your direction, and if you keep looking, you may end up where you are heading.

Released under the MIT License

- diff --git a/README.html b/README.html index a748800..9cf8370 100644 --- a/README.html +++ b/README.html @@ -10,12 +10,12 @@ - + -
Skip to content
On this page

Released under the MIT License

- diff --git a/api.html b/api.html index a1b0f4b..c38e912 100644 --- a/api.html +++ b/api.html @@ -10,12 +10,12 @@ - + -
Skip to content
On this page

API

XCoin provides a unified API for client programs, and provides the following information through the API

  • status:provides the running status of the current trading bot
    • getInitData:Get bot initialization data
    • refreshData:to obtain real-time trading data of bots
  • operation:Provides interactive operations with the current trading bot
    • bug:buy long or short
    • sell:sell long or short
    • sellAll:clearance
    • addSymbol:adds the trading pair to the monitoring pool
    • removeAllSymbol:Empty monitor pool
    • removeSymbol:removes the trading pair from the monitoring pool
    • updateConfig:Update bot settings
    • updateSymbolFuture:Update futures related settings, such as leverage
  • market:provides relevant operations of the exchange corresponding to the current trading bot, such as obtaining products, quotations, etc.
  • backtest:provides backtest related data
  • panacea:provides Panacea client-side related content

Released under the MIT License

- diff --git a/assets/README.md.774d846d.js b/assets/README.md.2de6eb80.js similarity index 93% rename from assets/README.md.774d846d.js rename to assets/README.md.2de6eb80.js index fa2b1e7..6c1392e 100644 --- a/assets/README.md.774d846d.js +++ b/assets/README.md.2de6eb80.js @@ -1 +1 @@ -import{_ as e,c as a,o as t,N as r}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"User Document","description":"","frontmatter":{},"headers":[],"relativePath":"README.md","lastUpdated":1685515852000}'),o={name:"README.md"},s=r('

User Document

Base:

Advance:

',5),i=[s];function l(n,c,_,d,h,p){return t(),a("div",null,i)}const m=e(o,[["render",l]]);export{u as __pageData,m as default}; +import{_ as e,c as a,o as t,N as r}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"User Document","description":"","frontmatter":{},"headers":[],"relativePath":"README.md","lastUpdated":1685521513000}'),o={name:"README.md"},s=r('

User Document

Base:

Advance:

',5),i=[s];function l(n,c,_,d,h,p){return t(),a("div",null,i)}const m=e(o,[["render",l]]);export{u as __pageData,m as default}; diff --git a/assets/README.md.774d846d.lean.js b/assets/README.md.2de6eb80.lean.js similarity index 82% rename from assets/README.md.774d846d.lean.js rename to assets/README.md.2de6eb80.lean.js index 8b16920..12fb0ef 100644 --- a/assets/README.md.774d846d.lean.js +++ b/assets/README.md.2de6eb80.lean.js @@ -1 +1 @@ -import{_ as e,c as a,o as t,N as r}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"User Document","description":"","frontmatter":{},"headers":[],"relativePath":"README.md","lastUpdated":1685515852000}'),o={name:"README.md"},s=r("",5),i=[s];function l(n,c,_,d,h,p){return t(),a("div",null,i)}const m=e(o,[["render",l]]);export{u as __pageData,m as default}; +import{_ as e,c as a,o as t,N as r}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"User Document","description":"","frontmatter":{},"headers":[],"relativePath":"README.md","lastUpdated":1685521513000}'),o={name:"README.md"},s=r("",5),i=[s];function l(n,c,_,d,h,p){return t(),a("div",null,i)}const m=e(o,[["render",l]]);export{u as __pageData,m as default}; diff --git a/assets/api.md.5bcff37c.js b/assets/api.md.1ad43746.js similarity index 96% rename from assets/api.md.5bcff37c.js rename to assets/api.md.1ad43746.js index 5088c71..9afe719 100644 --- a/assets/api.md.5bcff37c.js +++ b/assets/api.md.1ad43746.js @@ -1 +1 @@ -import{_ as t,c as e,o as a,N as i}from"./chunks/framework.9a843496.js";const _=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"api.md","lastUpdated":1685515852000}'),o={name:"api.md"},r=i('

API

XCoin provides a unified API for client programs, and provides the following information through the API

',3),l=[r];function n(s,d,p,c,u,h){return a(),e("div",null,l)}const g=t(o,[["render",n]]);export{_ as __pageData,g as default}; +import{_ as t,c as e,o as a,N as i}from"./chunks/framework.9a843496.js";const _=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"api.md","lastUpdated":1685521513000}'),o={name:"api.md"},r=i('

API

XCoin provides a unified API for client programs, and provides the following information through the API

',3),l=[r];function n(s,d,p,c,u,h){return a(),e("div",null,l)}const g=t(o,[["render",n]]);export{_ as __pageData,g as default}; diff --git a/assets/api.md.5bcff37c.lean.js b/assets/api.md.1ad43746.lean.js similarity index 82% rename from assets/api.md.5bcff37c.lean.js rename to assets/api.md.1ad43746.lean.js index 9d1220f..fddb432 100644 --- a/assets/api.md.5bcff37c.lean.js +++ b/assets/api.md.1ad43746.lean.js @@ -1 +1 @@ -import{_ as t,c as e,o as a,N as i}from"./chunks/framework.9a843496.js";const _=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"api.md","lastUpdated":1685515852000}'),o={name:"api.md"},r=i("",3),l=[r];function n(s,d,p,c,u,h){return a(),e("div",null,l)}const g=t(o,[["render",n]]);export{_ as __pageData,g as default}; +import{_ as t,c as e,o as a,N as i}from"./chunks/framework.9a843496.js";const _=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"api.md","lastUpdated":1685521513000}'),o={name:"api.md"},r=i("",3),l=[r];function n(s,d,p,c,u,h){return a(),e("div",null,l)}const g=t(o,[["render",n]]);export{_ as __pageData,g as default}; diff --git a/assets/config.md.24bf3995.js b/assets/config.md.87c1437e.js similarity index 99% rename from assets/config.md.24bf3995.js rename to assets/config.md.87c1437e.js index 12cf040..012e589 100644 --- a/assets/config.md.24bf3995.js +++ b/assets/config.md.87c1437e.js @@ -1,4 +1,4 @@ -import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"config.md","lastUpdated":1685515852000}'),p={name:"config.md"},o=l(`

Configuration

XCoin initializes bots through configuration files, including the following types of configuration files

Configuration file path

config subfolder

data/config subfolder

The configuration file can be modified in real time through the client, and the modification of some core parameters requires restarting the bot. For details, please refer to pm2 management bot

Configuration file loading process

The loading process of the configuration file is as follows

  1. Load the initial configuration file, /config/conf-base.js to get all the initial configuration
  2. Load the specified configuration file: the configuration file specified by --conf in the command line parameters and overwrite the initial configuration
  3. Load the last used configuration file: If --conf does not specify a configuration file but /data/config/last_config.json exists, then load last-config.json
  4. Load the configuration specified by the command line parameters. For example, if the user acts yarn trade binance --paper --trade_type autoBuy, then paper=true and trade_type='autoBuy' will become the preferred configuration

Basic configuration

The basic configuration file is located in the /confg directory, and the file name is conf-base.js. The configuration parameters are divided into five parts: bots, exchanges, orders, selling points, and simulated transactions according to usage scenarios

javascript
{
+import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"config.md","lastUpdated":1685521513000}'),p={name:"config.md"},o=l(`

Configuration

XCoin initializes bots through configuration files, including the following types of configuration files

Configuration file path

config subfolder

  • conf-base.js basic configuration

  • conf-secret.js security configuration

  • conf-server.js server configuration

  • conf-future.js futures basic configuration

data/config subfolder

  • Profiles that store all user settings

  • Store the configuration file last_config.json of the last run

The configuration file can be modified in real time through the client, and the modification of some core parameters requires restarting the bot. For details, please refer to pm2 management bot

Configuration file loading process

The loading process of the configuration file is as follows

  1. Load the initial configuration file, /config/conf-base.js to get all the initial configuration
  2. Load the specified configuration file: the configuration file specified by --conf in the command line parameters and overwrite the initial configuration
  3. Load the last used configuration file: If --conf does not specify a configuration file but /data/config/last_config.json exists, then load last-config.json
  4. Load the configuration specified by the command line parameters. For example, if the user acts yarn trade binance --paper --trade_type autoBuy, then paper=true and trade_type='autoBuy' will become the preferred configuration

Basic configuration

The basic configuration file is located in the /confg directory, and the file name is conf-base.js. The configuration parameters are divided into five parts: bots, exchanges, orders, selling points, and simulated transactions according to usage scenarios

javascript
{
    bot: [//bot configuration
      {
        name: 'strategy', //Strategy
diff --git a/assets/config.md.24bf3995.lean.js b/assets/config.md.87c1437e.lean.js
similarity index 83%
rename from assets/config.md.24bf3995.lean.js
rename to assets/config.md.87c1437e.lean.js
index 7d80550..0bd4bc7 100644
--- a/assets/config.md.24bf3995.lean.js
+++ b/assets/config.md.87c1437e.lean.js
@@ -1 +1 @@
-import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"config.md","lastUpdated":1685515852000}'),p={name:"config.md"},o=l("",25),e=[o];function t(c,F,r,y,D,i){return a(),n("div",null,e)}const f=s(p,[["render",t]]);export{u as __pageData,f as default};
+import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"config.md","lastUpdated":1685521513000}'),p={name:"config.md"},o=l("",25),e=[o];function t(c,F,r,y,D,i){return a(),n("div",null,e)}const f=s(p,[["render",t]]);export{u as __pageData,f as default};
diff --git a/assets/developer.md.f736e55d.js b/assets/developer.md.bf9c8192.js
similarity index 98%
rename from assets/developer.md.f736e55d.js
rename to assets/developer.md.bf9c8192.js
index 3ed09e8..4135da1 100644
--- a/assets/developer.md.f736e55d.js
+++ b/assets/developer.md.bf9c8192.js
@@ -1 +1 @@
-import{_ as e,c as t,o as a,N as n}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Developer","description":"","frontmatter":{},"headers":[],"relativePath":"developer.md","lastUpdated":1685515852000}'),s={name:"developer.md"},i=n('

Developer

XCoin provides some basic extensions to enhance functions, and developers can also develop more functions through extension modules.

API extensions /extensions/output

The relevant codes for connecting XCoin to the client are provided. At present, XCoin only supports APIs matching Panacea. Panacea is a full-platform (ANDROID, IOS, WINDOWS, MAC, LINUX) trading bot real-time status management application, which is highly compatible with XCoin Integration, can provide interfaces for all configurations, strategies, and real-time trading.

You can get more help at API

Exchange Extensions /extensions/exchanges

The exchange extension provides the data source for the bot to trade. By default, the extension provided by ccxt is used. ccxt provides a large number of exchange data interfaces. If you need to develop an exchange-specific interface, you can create it under extensions Own exchange interface.

The sim exchange is the main interface for simulated trading, including paper and sim. The former uses real exchange data for simulated trading, and the latter uses historical data for backtesting transactions.

You can get more help at exchangse

Strategy Extensions /extensions/strategies

Strategy extension provides the base class strategy.js and built-in strategy based on strategy extension

Strategy extensions /extensions/strategies/list

The built-in strategy list includes four separate strategies including RSI and a compound strategy. You may easily obtain new strategies by combining json files

You can get more help with Trading Strategies

',14),o=[i];function r(c,l,h,d,p,g){return a(),t("div",null,o)}const f=e(s,[["render",r]]);export{u as __pageData,f as default}; +import{_ as e,c as t,o as a,N as n}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Developer","description":"","frontmatter":{},"headers":[],"relativePath":"developer.md","lastUpdated":1685521513000}'),s={name:"developer.md"},i=n('

Developer

XCoin provides some basic extensions to enhance functions, and developers can also develop more functions through extension modules.

API extensions /extensions/output

The relevant codes for connecting XCoin to the client are provided. At present, XCoin only supports APIs matching Panacea. Panacea is a full-platform (ANDROID, IOS, WINDOWS, MAC, LINUX) trading bot real-time status management application, which is highly compatible with XCoin Integration, can provide interfaces for all configurations, strategies, and real-time trading.

You can get more help at API

Exchange Extensions /extensions/exchanges

The exchange extension provides the data source for the bot to trade. By default, the extension provided by ccxt is used. ccxt provides a large number of exchange data interfaces. If you need to develop an exchange-specific interface, you can create it under extensions Own exchange interface.

The sim exchange is the main interface for simulated trading, including paper and sim. The former uses real exchange data for simulated trading, and the latter uses historical data for backtesting transactions.

You can get more help at exchangse

Strategy Extensions /extensions/strategies

Strategy extension provides the base class strategy.js and built-in strategy based on strategy extension

Strategy extensions /extensions/strategies/list

The built-in strategy list includes four separate strategies including RSI and a compound strategy. You may easily obtain new strategies by combining json files

You can get more help with Trading Strategies

',14),o=[i];function r(c,l,h,d,p,g){return a(),t("div",null,o)}const f=e(s,[["render",r]]);export{u as __pageData,f as default}; diff --git a/assets/developer.md.f736e55d.lean.js b/assets/developer.md.bf9c8192.lean.js similarity index 83% rename from assets/developer.md.f736e55d.lean.js rename to assets/developer.md.bf9c8192.lean.js index 2911e46..ea21f77 100644 --- a/assets/developer.md.f736e55d.lean.js +++ b/assets/developer.md.bf9c8192.lean.js @@ -1 +1 @@ -import{_ as e,c as t,o as a,N as n}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Developer","description":"","frontmatter":{},"headers":[],"relativePath":"developer.md","lastUpdated":1685515852000}'),s={name:"developer.md"},i=n("",14),o=[i];function r(c,l,h,d,p,g){return a(),t("div",null,o)}const f=e(s,[["render",r]]);export{u as __pageData,f as default}; +import{_ as e,c as t,o as a,N as n}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Developer","description":"","frontmatter":{},"headers":[],"relativePath":"developer.md","lastUpdated":1685521513000}'),s={name:"developer.md"},i=n("",14),o=[i];function r(c,l,h,d,p,g){return a(),t("div",null,o)}const f=e(s,[["render",r]]);export{u as __pageData,f as default}; diff --git a/assets/exchange.md.368a3ea4.js b/assets/exchange.md.1a30b858.js similarity index 99% rename from assets/exchange.md.368a3ea4.js rename to assets/exchange.md.1a30b858.js index 708afea..2e99c3f 100644 --- a/assets/exchange.md.368a3ea4.js +++ b/assets/exchange.md.1a30b858.js @@ -1,4 +1,4 @@ -import{_ as s,c as a,o as n,N as e}from"./chunks/framework.9a843496.js";const d=JSON.parse('{"title":"Exchange","description":"","frontmatter":{},"headers":[],"relativePath":"exchange.md","lastUpdated":1685515852000}'),o={name:"exchange.md"},l=e(`

Exchange

XCoin supports all exchanges supported by ccxt (more than 100 types), and through the packaging of ccxt/exchange.js, it can handle almost all data required for transactions. Currently we have Binance, BinanceUSDM, and Mexc have passed the test. You can also try other exchanges such as OKEX, HuoBi, etc.

At the same time, when simulating or backtesting transactions, XCoin supports obtaining historical or real-time data through sim/exchange.js to complete the simulation or backtest transaction process

We are also considering adding a DEFI type exchange based on pancakswap, so stay tuned.

Introduction

ccxt

Supports nearly a hundred mainstream exchanges that obtain data through the ccxt module. Through the api key provided by the user, the exchange can pass through three modes: anonymous, user authentication, and websocket authentication Get the data, you can call it conveniently as needed

sim

Simulated exchange, used to support simulated and backtested transactions

Add new exchange

XCoin initializes the exchange through the following methods

javascript
try {
+import{_ as s,c as a,o as n,N as e}from"./chunks/framework.9a843496.js";const d=JSON.parse('{"title":"Exchange","description":"","frontmatter":{},"headers":[],"relativePath":"exchange.md","lastUpdated":1685521513000}'),o={name:"exchange.md"},l=e(`

Exchange

XCoin supports all exchanges supported by ccxt (more than 100 types), and through the packaging of ccxt/exchange.js, it can handle almost all data required for transactions. Currently we have Binance, BinanceUSDM, and Mexc have passed the test. You can also try other exchanges such as OKEX, HuoBi, etc.

At the same time, when simulating or backtesting transactions, XCoin supports obtaining historical or real-time data through sim/exchange.js to complete the simulation or backtest transaction process

We are also considering adding a DEFI type exchange based on pancakswap, so stay tuned.

Introduction

ccxt

Supports nearly a hundred mainstream exchanges that obtain data through the ccxt module. Through the api key provided by the user, the exchange can pass through three modes: anonymous, user authentication, and websocket authentication Get the data, you can call it conveniently as needed

sim

Simulated exchange, used to support simulated and backtested transactions

Add new exchange

XCoin initializes the exchange through the following methods

javascript
try {
        if (so. mode !== 'live') {
          s.exchange = require(path.resolve(__dirname, '../extensions/exchanges/sim/exchange'))(conf, so, s)
        }
diff --git a/assets/exchange.md.368a3ea4.lean.js b/assets/exchange.md.1a30b858.lean.js
similarity index 82%
rename from assets/exchange.md.368a3ea4.lean.js
rename to assets/exchange.md.1a30b858.lean.js
index 1e24b6d..00a8967 100644
--- a/assets/exchange.md.368a3ea4.lean.js
+++ b/assets/exchange.md.1a30b858.lean.js
@@ -1 +1 @@
-import{_ as s,c as a,o as n,N as e}from"./chunks/framework.9a843496.js";const d=JSON.parse('{"title":"Exchange","description":"","frontmatter":{},"headers":[],"relativePath":"exchange.md","lastUpdated":1685515852000}'),o={name:"exchange.md"},l=e("",14),t=[l];function p(c,r,y,i,F,h){return n(),a("div",null,t)}const A=s(o,[["render",p]]);export{d as __pageData,A as default};
+import{_ as s,c as a,o as n,N as e}from"./chunks/framework.9a843496.js";const d=JSON.parse('{"title":"Exchange","description":"","frontmatter":{},"headers":[],"relativePath":"exchange.md","lastUpdated":1685521513000}'),o={name:"exchange.md"},l=e("",14),t=[l];function p(c,r,y,i,F,h){return n(),a("div",null,t)}const A=s(o,[["render",p]]);export{d as __pageData,A as default};
diff --git a/assets/faq.md.bd3b202b.js b/assets/faq.md.6a07f812.js
similarity index 98%
rename from assets/faq.md.bd3b202b.js
rename to assets/faq.md.6a07f812.js
index 871cf9e..ce1158f 100644
--- a/assets/faq.md.bd3b202b.js
+++ b/assets/faq.md.6a07f812.js
@@ -1 +1 @@
-import{_ as e,c as a,o as i,N as r}from"./chunks/framework.9a843496.js";const c=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"faq.md","lastUpdated":1685515852000}'),t={name:"faq.md"},o=r('

FAQ

Here are some frequently asked questions and responses from the community.

If you have a question that isn't answered here, please ask it in the community

Thanks!

Question

Trading

Answer

Trading

Will I make money with XCoin?

That depends… Different configurations and strategies will yield different results.

The current default config and parameters will likely lose you money, so proceed with caution. Try running simulations and paper trading first to see how the bot acts (see warning below).

Why do simulations, paper trading, and live trading all yield different results?

Simulations and paper trading almost always give overly optimistic results compared to live trading. This is because simulations and paper trading both make assumptions about when/if an order is filled.

Because XCoin defaults to using Limit orders (which often lessen fees), there tends to be much more slippage (the difference between when the bot decides to buy and when it actually buys) in live trading. Due to this, live trading is almost always worse than sims and paper trading.

Also, remember that past results do not guarantee future returns.

Why should I use simulations or paper trading if they do not reflect live trading?

Simulations are more optimistic than paper trading. Paper trading is more optimistic than live trading. Therefore, if a simulation does not yield good results, odds are that neither will paper trading or (by extension) live trading.

Does XCoin use Limit (maker) orders or Market (taker) orders?

XCoin uses Limit orders by default because on most exchanges, Limit orders result in lower fees than Market orders. For instance, on GDAX there is no fee for a Limit order trade compared to a 0.25% (BTC) or 0.3% (ETH & LTC) trade fee on a Market order.

',20),n=[o];function s(d,l,h,u,m,p){return i(),a("div",null,n)}const g=e(t,[["render",s]]);export{c as __pageData,g as default}; +import{_ as e,c as a,o as i,N as r}from"./chunks/framework.9a843496.js";const c=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"faq.md","lastUpdated":1685521513000}'),t={name:"faq.md"},o=r('

FAQ

Here are some frequently asked questions and responses from the community.

If you have a question that isn't answered here, please ask it in the community

Thanks!

Question

Trading

Answer

Trading

Will I make money with XCoin?

That depends… Different configurations and strategies will yield different results.

The current default config and parameters will likely lose you money, so proceed with caution. Try running simulations and paper trading first to see how the bot acts (see warning below).

Why do simulations, paper trading, and live trading all yield different results?

Simulations and paper trading almost always give overly optimistic results compared to live trading. This is because simulations and paper trading both make assumptions about when/if an order is filled.

Because XCoin defaults to using Limit orders (which often lessen fees), there tends to be much more slippage (the difference between when the bot decides to buy and when it actually buys) in live trading. Due to this, live trading is almost always worse than sims and paper trading.

Also, remember that past results do not guarantee future returns.

Why should I use simulations or paper trading if they do not reflect live trading?

Simulations are more optimistic than paper trading. Paper trading is more optimistic than live trading. Therefore, if a simulation does not yield good results, odds are that neither will paper trading or (by extension) live trading.

Does XCoin use Limit (maker) orders or Market (taker) orders?

XCoin uses Limit orders by default because on most exchanges, Limit orders result in lower fees than Market orders. For instance, on GDAX there is no fee for a Limit order trade compared to a 0.25% (BTC) or 0.3% (ETH & LTC) trade fee on a Market order.

',20),n=[o];function s(d,l,h,u,m,p){return i(),a("div",null,n)}const g=e(t,[["render",s]]);export{c as __pageData,g as default}; diff --git a/assets/faq.md.bd3b202b.lean.js b/assets/faq.md.6a07f812.lean.js similarity index 82% rename from assets/faq.md.bd3b202b.lean.js rename to assets/faq.md.6a07f812.lean.js index 166c42b..ba0ec49 100644 --- a/assets/faq.md.bd3b202b.lean.js +++ b/assets/faq.md.6a07f812.lean.js @@ -1 +1 @@ -import{_ as e,c as a,o as i,N as r}from"./chunks/framework.9a843496.js";const c=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"faq.md","lastUpdated":1685515852000}'),t={name:"faq.md"},o=r("",20),n=[o];function s(d,l,h,u,m,p){return i(),a("div",null,n)}const g=e(t,[["render",s]]);export{c as __pageData,g as default}; +import{_ as e,c as a,o as i,N as r}from"./chunks/framework.9a843496.js";const c=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"faq.md","lastUpdated":1685521513000}'),t={name:"faq.md"},o=r("",20),n=[o];function s(d,l,h,u,m,p){return i(),a("div",null,n)}const g=e(t,[["render",s]]);export{c as __pageData,g as default}; diff --git a/assets/index.md.1c1c2e14.js b/assets/index.md.4bd7b1ab.js similarity index 96% rename from assets/index.md.1c1c2e14.js rename to assets/index.md.4bd7b1ab.js index b843e5f..078b406 100644 --- a/assets/index.md.1c1c2e14.js +++ b/assets/index.md.4bd7b1ab.js @@ -1 +1 @@ -import{_ as t,c as e,o as a}from"./chunks/framework.9a843496.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"XCoin","text":"Next Gerneration Trading Bot","tagline":"A Simple and Powerful Trading Robot Based on Nodejs.","image":{"src":"/images/screenshot.jpg","alt":"XCoin"},"actions":[{"theme":"brand","text":"Get Started","link":"/start"},{"theme":"alt","text":"View on GitHub","link":"https://github.com/rainfu/xcoin"}]},"features":[{"title":"Unlimited trading pairs","details":"Support trading multiple trading pairs at the same time, you can trade all pairs at the same time."},{"title":"Unlimited exchanges","details":"Support all exchanges supported by ccxt, easily add custom exchanges."},{"title":"New Strategy Framework","details":"Support all trading strategies supported by technicalindicators, and easily extend new strategies through JSON files."},{"title":"Support long and short trading","details":"Supports futures trading and can control whether it is long or short or both trading."},{"title":"Four trading modes","details":"Support multiple trading methods, automatic buying, manual buying, manual selling or full manual."},{"title":"Watch Pool Customization","details":"Supports Watching of purchased items, blacklist, and dynamic addition of watch items."},{"title":"Multiple bots running at the same time","details":"Supports obtaining price updates on a separate thread, and supports deploying multiple bots on the same machine."},{"title":"Support simulation and backtest","details":"Supports real trade, virtual trade and backtesting."},{"title":"Mobile and Desktop Support","details":"Support all mobile devices and desktop devices, real-time control of all states and operations of the robot"}]},"headers":[],"relativePath":"index.md","lastUpdated":1685515852000}'),i={name:"index.md"};function o(n,s,r,l,d,p){return a(),e("div")}const m=t(i,[["render",o]]);export{c as __pageData,m as default}; +import{_ as t,c as e,o as a}from"./chunks/framework.9a843496.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"XCoin","text":"Next Gerneration Trading Bot","tagline":"A Simple and Powerful Trading Robot Based on Nodejs.","image":{"src":"/images/screenshot.jpg","alt":"XCoin"},"actions":[{"theme":"brand","text":"Get Started","link":"/start"},{"theme":"alt","text":"View on GitHub","link":"https://github.com/rainfu/xcoin"}]},"features":[{"title":"Unlimited trading pairs","details":"Support trading multiple trading pairs at the same time, you can trade all pairs at the same time."},{"title":"Unlimited exchanges","details":"Support all exchanges supported by ccxt, easily add custom exchanges."},{"title":"New Strategy Framework","details":"Support all trading strategies supported by technicalindicators, and easily extend new strategies through JSON files."},{"title":"Support long and short trading","details":"Supports futures trading and can control whether it is long or short or both trading."},{"title":"Four trading modes","details":"Support multiple trading methods, automatic buying, manual buying, manual selling or full manual."},{"title":"Watch Pool Customization","details":"Supports Watching of purchased items, blacklist, and dynamic addition of watch items."},{"title":"Multiple bots running at the same time","details":"Supports obtaining price updates on a separate thread, and supports deploying multiple bots on the same machine."},{"title":"Support simulation and backtest","details":"Supports real trade, virtual trade and backtesting."},{"title":"Mobile and Desktop Support","details":"Support all mobile devices and desktop devices, real-time control of all states and operations of the robot"}]},"headers":[],"relativePath":"index.md","lastUpdated":1685521513000}'),i={name:"index.md"};function o(n,s,r,l,d,p){return a(),e("div")}const m=t(i,[["render",o]]);export{c as __pageData,m as default}; diff --git a/assets/index.md.1c1c2e14.lean.js b/assets/index.md.4bd7b1ab.lean.js similarity index 96% rename from assets/index.md.1c1c2e14.lean.js rename to assets/index.md.4bd7b1ab.lean.js index b843e5f..078b406 100644 --- a/assets/index.md.1c1c2e14.lean.js +++ b/assets/index.md.4bd7b1ab.lean.js @@ -1 +1 @@ -import{_ as t,c as e,o as a}from"./chunks/framework.9a843496.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"XCoin","text":"Next Gerneration Trading Bot","tagline":"A Simple and Powerful Trading Robot Based on Nodejs.","image":{"src":"/images/screenshot.jpg","alt":"XCoin"},"actions":[{"theme":"brand","text":"Get Started","link":"/start"},{"theme":"alt","text":"View on GitHub","link":"https://github.com/rainfu/xcoin"}]},"features":[{"title":"Unlimited trading pairs","details":"Support trading multiple trading pairs at the same time, you can trade all pairs at the same time."},{"title":"Unlimited exchanges","details":"Support all exchanges supported by ccxt, easily add custom exchanges."},{"title":"New Strategy Framework","details":"Support all trading strategies supported by technicalindicators, and easily extend new strategies through JSON files."},{"title":"Support long and short trading","details":"Supports futures trading and can control whether it is long or short or both trading."},{"title":"Four trading modes","details":"Support multiple trading methods, automatic buying, manual buying, manual selling or full manual."},{"title":"Watch Pool Customization","details":"Supports Watching of purchased items, blacklist, and dynamic addition of watch items."},{"title":"Multiple bots running at the same time","details":"Supports obtaining price updates on a separate thread, and supports deploying multiple bots on the same machine."},{"title":"Support simulation and backtest","details":"Supports real trade, virtual trade and backtesting."},{"title":"Mobile and Desktop Support","details":"Support all mobile devices and desktop devices, real-time control of all states and operations of the robot"}]},"headers":[],"relativePath":"index.md","lastUpdated":1685515852000}'),i={name:"index.md"};function o(n,s,r,l,d,p){return a(),e("div")}const m=t(i,[["render",o]]);export{c as __pageData,m as default}; +import{_ as t,c as e,o as a}from"./chunks/framework.9a843496.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"XCoin","text":"Next Gerneration Trading Bot","tagline":"A Simple and Powerful Trading Robot Based on Nodejs.","image":{"src":"/images/screenshot.jpg","alt":"XCoin"},"actions":[{"theme":"brand","text":"Get Started","link":"/start"},{"theme":"alt","text":"View on GitHub","link":"https://github.com/rainfu/xcoin"}]},"features":[{"title":"Unlimited trading pairs","details":"Support trading multiple trading pairs at the same time, you can trade all pairs at the same time."},{"title":"Unlimited exchanges","details":"Support all exchanges supported by ccxt, easily add custom exchanges."},{"title":"New Strategy Framework","details":"Support all trading strategies supported by technicalindicators, and easily extend new strategies through JSON files."},{"title":"Support long and short trading","details":"Supports futures trading and can control whether it is long or short or both trading."},{"title":"Four trading modes","details":"Support multiple trading methods, automatic buying, manual buying, manual selling or full manual."},{"title":"Watch Pool Customization","details":"Supports Watching of purchased items, blacklist, and dynamic addition of watch items."},{"title":"Multiple bots running at the same time","details":"Supports obtaining price updates on a separate thread, and supports deploying multiple bots on the same machine."},{"title":"Support simulation and backtest","details":"Supports real trade, virtual trade and backtesting."},{"title":"Mobile and Desktop Support","details":"Support all mobile devices and desktop devices, real-time control of all states and operations of the robot"}]},"headers":[],"relativePath":"index.md","lastUpdated":1685521513000}'),i={name:"index.md"};function o(n,s,r,l,d,p){return a(),e("div")}const m=t(i,[["render",o]]);export{c as __pageData,m as default}; diff --git a/assets/pm2.md.900932fa.js b/assets/pm2.md.3c6fe67c.js similarity index 99% rename from assets/pm2.md.900932fa.js rename to assets/pm2.md.3c6fe67c.js index 4c0620a..95e4b01 100644 --- a/assets/pm2.md.900932fa.js +++ b/assets/pm2.md.3c6fe67c.js @@ -1,4 +1,4 @@ -import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const A=JSON.parse('{"title":"Use PM2 manage bots","description":"","frontmatter":{},"headers":[],"relativePath":"pm2.md","lastUpdated":1685515852000}'),o={name:"pm2.md"},p=l(`

Use PM2 manage bots

XCoin recommends that you manage your bot through pm2, through pm2 you can

  • Keep the main thread running continuously
  • Conveniently start main thread and price update thread at the same time
  • Conveniently restart threads when parameters change

Disadvantage: If you use pm2 to start the thread, some keyboard events may not be available on the server side

Install

bash
yarn global add pm2

How to

Suppose you need to manage a bot group that uses Binance Futures for trading through pm2. The group contains two bots and one price update thread. you need

  1. Create a binanceusdm.config.js file under /config/
javascript
module.exports = {
+import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const A=JSON.parse('{"title":"Use PM2  manage bots","description":"","frontmatter":{},"headers":[],"relativePath":"pm2.md","lastUpdated":1685521513000}'),o={name:"pm2.md"},p=l(`

Use PM2 manage bots

XCoin recommends that you manage your bot through pm2, through pm2 you can

  • Keep the main thread running continuously
  • Conveniently start main thread and price update thread at the same time
  • Conveniently restart threads when parameters change

Disadvantage: If you use pm2 to start the thread, some keyboard events may not be available on the server side

Install

bash
yarn global add pm2

How to

Suppose you need to manage a bot group that uses Binance Futures for trading through pm2. The group contains two bots and one price update thread. you need

  1. Create a binanceusdm.config.js file under /config/
javascript
module.exports = {
    apps: [
      {
        name: 'server', //price update
diff --git a/assets/pm2.md.900932fa.lean.js b/assets/pm2.md.3c6fe67c.lean.js
similarity index 83%
rename from assets/pm2.md.900932fa.lean.js
rename to assets/pm2.md.3c6fe67c.lean.js
index 349b42d..a6fd9e7 100644
--- a/assets/pm2.md.900932fa.lean.js
+++ b/assets/pm2.md.3c6fe67c.lean.js
@@ -1 +1 @@
-import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const A=JSON.parse('{"title":"Use PM2  manage bots","description":"","frontmatter":{},"headers":[],"relativePath":"pm2.md","lastUpdated":1685515852000}'),o={name:"pm2.md"},p=l("",19),e=[p];function t(r,c,y,D,F,i){return n(),a("div",null,e)}const d=s(o,[["render",t]]);export{A as __pageData,d as default};
+import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const A=JSON.parse('{"title":"Use PM2  manage bots","description":"","frontmatter":{},"headers":[],"relativePath":"pm2.md","lastUpdated":1685521513000}'),o={name:"pm2.md"},p=l("",19),e=[p];function t(r,c,y,D,F,i){return n(),a("div",null,e)}const d=s(o,[["render",t]]);export{A as __pageData,d as default};
diff --git a/assets/start.md.c4781097.js b/assets/start.md.3c3bf4c4.js
similarity index 99%
rename from assets/start.md.c4781097.js
rename to assets/start.md.3c3bf4c4.js
index 979d23a..1a26ae5 100644
--- a/assets/start.md.c4781097.js
+++ b/assets/start.md.3c3bf4c4.js
@@ -1,4 +1,4 @@
-import{_ as a,c as s,o as e,N as n}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"start.md","lastUpdated":1685515852000}'),o={name:"start.md"},l=n(`

Quick Start

Setp 1 Requirements

  • Windows / Linux / macOS 10 (or Docker)
  • Node.js (version 12.0.0 or higher) and MongoDB.

Setp 2 Install

run in terminal,

bash
git clone https://github.com/rainfu/xcoin.git

Or, to download directly,

bash
wget https://github.com/rainfu/xcoin/archive/master.tar.gz
+import{_ as a,c as s,o as e,N as n}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"start.md","lastUpdated":1685521513000}'),o={name:"start.md"},l=n(`

Quick Start

Setp 1 Requirements

  • Windows / Linux / macOS 10 (or Docker)
  • Node.js (version 12.0.0 or higher) and MongoDB.

Setp 2 Install

run in terminal,

bash
git clone https://github.com/rainfu/xcoin.git

Or, to download directly,

bash
wget https://github.com/rainfu/xcoin/archive/master.tar.gz
 tar -xf master.tar.gz
 mv xcoin-master xcoin

Create your security configuration file config/conf-secret-sample.js to config/conf-secret.js:

bash
cp conf --secret-sample.js conf.js
  • Add database, third-party exchange API and other necessary data, security has been seen, please do not provide transfer function in third-party API
  • View and edit conf-base.js to suit your trading habits.
  • View and edit conf-future.js to suit your futures trading habits.
  • If you need to use a separate price update thread, please modify conf-server.js
  • If you need to use PM2 to manage your threads, please view or edit binane.config.js

Initialize the project:

bash
cd xcoin
 yarn

Some common commands

Get help:

bash
node ./xcoin --help

List all trading strategies:

bash
node ./xcoin strategies

Get your assets on an exchange

bash
node ./xcoin exchange binance --balance

Run XCoin

The following command will simulate two trading pairs of BTC and ETH on Binance Exchange.

bash
node ./xcoin trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper

You can also use the yarn command directly, both have the same effect

bash
yarn trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper

Use the --paper flag to decide whether to trade live or paper.

Use the --trade_type flag to identify how the trading bot will trade, including

  • auto automatic trading

  • autoBuy buy automatically

  • autoSell automatically sell

  • manual

Use the --conf flag to identify the configuration file used by the trading robot, which will override the conf-base.js configuration file

The following command will trade the settings under the specified configuration file

bash
yarn trade binance --conf ./data/config/binance/30mf.json

For more transaction parameters that can be brought by the command line, please refer to the commands/trade.js file. All transaction references can be set directly in the config file

bash
yarn trade --help
`,33),t=[l];function p(c,r,i,d,C,h){return e(),s("div",null,t)}const m=a(o,[["render",p]]);export{u as __pageData,m as default}; diff --git a/assets/start.md.c4781097.lean.js b/assets/start.md.3c3bf4c4.lean.js similarity index 82% rename from assets/start.md.c4781097.lean.js rename to assets/start.md.3c3bf4c4.lean.js index a8841d9..f14badd 100644 --- a/assets/start.md.c4781097.lean.js +++ b/assets/start.md.3c3bf4c4.lean.js @@ -1 +1 @@ -import{_ as a,c as s,o as e,N as n}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"start.md","lastUpdated":1685515852000}'),o={name:"start.md"},l=n("",33),t=[l];function p(c,r,i,d,C,h){return e(),s("div",null,t)}const m=a(o,[["render",p]]);export{u as __pageData,m as default}; +import{_ as a,c as s,o as e,N as n}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"start.md","lastUpdated":1685521513000}'),o={name:"start.md"},l=n("",33),t=[l];function p(c,r,i,d,C,h){return e(),s("div",null,t)}const m=a(o,[["render",p]]);export{u as __pageData,m as default}; diff --git a/assets/strategy.md.d3fef1f4.js b/assets/strategy.md.e8847b69.js similarity index 99% rename from assets/strategy.md.d3fef1f4.js rename to assets/strategy.md.e8847b69.js index ea30bc7..fa72444 100644 --- a/assets/strategy.md.d3fef1f4.js +++ b/assets/strategy.md.e8847b69.js @@ -1,4 +1,4 @@ -import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const q=JSON.parse('{"title":"Strategy","description":"","frontmatter":{},"headers":[],"relativePath":"strategy.md","lastUpdated":1685515852000}'),o={name:"strategy.md"},p=l(`

Strategy

XCoin uses a new way to allow you to easily manage and understand strategy, manage strategies and create your own strategy files and test them conveniently by running the main program. XCoin uses the technicalindicators library as the basic calculation library of the strategy, including the K-line identification library and some other common strategy logic.

At present, XCoin provides 5 basic strategy libraries including K-line recognition library. In theory, you can run all dozens of basic strategies and unlimited combination strategies by adding JSON files without coding.

If you wish to quickly build a strategy file, you can

  • Understand the operating logic of the strategy class strategy.js
  • Familiar with the system strategy json file
  • Create your own system strategy or combined strategy files
  • Visually create combined strategy files

The operation logic of the strategy class

The interactive relationship between the XCoin main program and the strategy file during the running process, through the interaction to obtain trading signals for trading

  • load strategy file initialization strategy at initialization time
  • Obtain the preloaded data required by the strategy by preloading the K-line cycle
  • Interact with the strategy every poll of the main program
    • Transmit real-time K-line data to obtain strategy output value (calculate)
    • Calculate whether to trigger a trading signal (onPeriod) through the strategy output value
    • The data is displayed in the terminal container or client (onReport)

The K-line data is updated in real time according to the strategy data, so the trading signal is provided by the real-time K-line signal, and the K-line data includes buying and selling signals and values. The data of each K line is as follows

javascript
{
+import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const q=JSON.parse('{"title":"Strategy","description":"","frontmatter":{},"headers":[],"relativePath":"strategy.md","lastUpdated":1685521513000}'),o={name:"strategy.md"},p=l(`

Strategy

XCoin uses a new way to allow you to easily manage and understand strategy, manage strategies and create your own strategy files and test them conveniently by running the main program. XCoin uses the technicalindicators library as the basic calculation library of the strategy, including the K-line identification library and some other common strategy logic.

At present, XCoin provides 5 basic strategy libraries including K-line recognition library. In theory, you can run all dozens of basic strategies and unlimited combination strategies by adding JSON files without coding.

If you wish to quickly build a strategy file, you can

  • Understand the operating logic of the strategy class strategy.js
  • Familiar with the system strategy json file
  • Create your own system strategy or combined strategy files
  • Visually create combined strategy files

The operation logic of the strategy class

The interactive relationship between the XCoin main program and the strategy file during the running process, through the interaction to obtain trading signals for trading

  • load strategy file initialization strategy at initialization time
  • Obtain the preloaded data required by the strategy by preloading the K-line cycle
  • Interact with the strategy every poll of the main program
    • Transmit real-time K-line data to obtain strategy output value (calculate)
    • Calculate whether to trigger a trading signal (onPeriod) through the strategy output value
    • The data is displayed in the terminal container or client (onReport)

The K-line data is updated in real time according to the strategy data, so the trading signal is provided by the real-time K-line signal, and the K-line data includes buying and selling signals and values. The data of each K line is as follows

javascript
{
      "period_id": "2h233427",
      "size": "2h",
      "time": 1680674400000,
diff --git a/assets/strategy.md.d3fef1f4.lean.js b/assets/strategy.md.e8847b69.lean.js
similarity index 82%
rename from assets/strategy.md.d3fef1f4.lean.js
rename to assets/strategy.md.e8847b69.lean.js
index 4934f79..d128f84 100644
--- a/assets/strategy.md.d3fef1f4.lean.js
+++ b/assets/strategy.md.e8847b69.lean.js
@@ -1 +1 @@
-import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const q=JSON.parse('{"title":"Strategy","description":"","frontmatter":{},"headers":[],"relativePath":"strategy.md","lastUpdated":1685515852000}'),o={name:"strategy.md"},p=l("",18),t=[p];function e(r,c,F,y,D,i){return n(),a("div",null,t)}const d=s(o,[["render",e]]);export{q as __pageData,d as default};
+import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const q=JSON.parse('{"title":"Strategy","description":"","frontmatter":{},"headers":[],"relativePath":"strategy.md","lastUpdated":1685521513000}'),o={name:"strategy.md"},p=l("",18),t=[p];function e(r,c,F,y,D,i){return n(),a("div",null,t)}const d=s(o,[["render",e]]);export{q as __pageData,d as default};
diff --git a/assets/zh_README.md.1b2c4e67.js b/assets/zh_README.md.0a0a0a63.js
similarity index 93%
rename from assets/zh_README.md.1b2c4e67.js
rename to assets/zh_README.md.0a0a0a63.js
index 988302d..738f75a 100644
--- a/assets/zh_README.md.1b2c4e67.js
+++ b/assets/zh_README.md.0a0a0a63.js
@@ -1 +1 @@
-import{_ as a,c as e,o as t,N as r}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"用户文档","description":"","frontmatter":{},"headers":[],"relativePath":"zh/README.md","lastUpdated":1685515852000}'),i={name:"zh/README.md"},l=r('

用户文档

基础:

高级:

',5),o=[l];function s(n,_,c,h,p,d){return t(),e("div",null,o)}const m=a(i,[["render",s]]);export{u as __pageData,m as default}; +import{_ as a,c as e,o as t,N as r}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"用户文档","description":"","frontmatter":{},"headers":[],"relativePath":"zh/README.md","lastUpdated":1685521513000}'),i={name:"zh/README.md"},l=r('

用户文档

基础:

高级:

',5),o=[l];function s(n,_,c,h,p,d){return t(),e("div",null,o)}const m=a(i,[["render",s]]);export{u as __pageData,m as default}; diff --git a/assets/zh_README.md.1b2c4e67.lean.js b/assets/zh_README.md.0a0a0a63.lean.js similarity index 83% rename from assets/zh_README.md.1b2c4e67.lean.js rename to assets/zh_README.md.0a0a0a63.lean.js index 5914d95..daa7657 100644 --- a/assets/zh_README.md.1b2c4e67.lean.js +++ b/assets/zh_README.md.0a0a0a63.lean.js @@ -1 +1 @@ -import{_ as a,c as e,o as t,N as r}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"用户文档","description":"","frontmatter":{},"headers":[],"relativePath":"zh/README.md","lastUpdated":1685515852000}'),i={name:"zh/README.md"},l=r("",5),o=[l];function s(n,_,c,h,p,d){return t(),e("div",null,o)}const m=a(i,[["render",s]]);export{u as __pageData,m as default}; +import{_ as a,c as e,o as t,N as r}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"用户文档","description":"","frontmatter":{},"headers":[],"relativePath":"zh/README.md","lastUpdated":1685521513000}'),i={name:"zh/README.md"},l=r("",5),o=[l];function s(n,_,c,h,p,d){return t(),e("div",null,o)}const m=a(i,[["render",s]]);export{u as __pageData,m as default}; diff --git a/assets/zh_api.md.9b1e7d12.js b/assets/zh_api.md.4eb83246.js similarity index 95% rename from assets/zh_api.md.9b1e7d12.js rename to assets/zh_api.md.4eb83246.js index 9200275..27e2653 100644 --- a/assets/zh_api.md.9b1e7d12.js +++ b/assets/zh_api.md.4eb83246.js @@ -1 +1 @@ -import{_ as l,c as a,o as e,N as i}from"./chunks/framework.9a843496.js";const h=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"zh/api.md","lastUpdated":1685515852000}'),t={name:"zh/api.md"},r=i('

API

XCoin为客户端程序提供一套统一的API,通过API提供以下几个方面的信息

  • status 提供当前交易机器人的运行状态
    • getInitData 获得机器人初始化数据
    • refreshData 获得机器人实时交易数据
  • operation 提供与当前交易机器人进行的交互操作,如买卖或更新交易对等
    • bug 买入多或空
    • sell 卖出多或空
    • sellAll 清仓
    • addSymbol 将交易对添加至监控池
    • removeAllSymbol 清空监控池
    • removeSymbol 从监控池移除交易对
    • updateConfig 更新机器人设置
    • updateSymbolFuture 更新期货相关设置,如杠杆
  • market 提供当前交易机器人对应的交易所的相关操作,如获得产品,报价等
  • backtest 提供回测相关数据
  • panacea 提供 灵丹 客户端相关内容
',3),o=[r];function s(n,_,p,c,d,u){return e(),a("div",null,o)}const f=l(t,[["render",s]]);export{h as __pageData,f as default}; +import{_ as l,c as a,o as e,N as i}from"./chunks/framework.9a843496.js";const h=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"zh/api.md","lastUpdated":1685521513000}'),t={name:"zh/api.md"},r=i('

API

XCoin为客户端程序提供一套统一的API,通过API提供以下几个方面的信息

  • status 提供当前交易机器人的运行状态
    • getInitData 获得机器人初始化数据
    • refreshData 获得机器人实时交易数据
  • operation 提供与当前交易机器人进行的交互操作,如买卖或更新交易对等
    • bug 买入多或空
    • sell 卖出多或空
    • sellAll 清仓
    • addSymbol 将交易对添加至监控池
    • removeAllSymbol 清空监控池
    • removeSymbol 从监控池移除交易对
    • updateConfig 更新机器人设置
    • updateSymbolFuture 更新期货相关设置,如杠杆
  • market 提供当前交易机器人对应的交易所的相关操作,如获得产品,报价等
  • backtest 提供回测相关数据
  • panacea 提供 灵丹 客户端相关内容
',3),o=[r];function s(n,_,p,c,d,u){return e(),a("div",null,o)}const f=l(t,[["render",s]]);export{h as __pageData,f as default}; diff --git a/assets/zh_api.md.9b1e7d12.lean.js b/assets/zh_api.md.4eb83246.lean.js similarity index 82% rename from assets/zh_api.md.9b1e7d12.lean.js rename to assets/zh_api.md.4eb83246.lean.js index 3ff911a..168ba3c 100644 --- a/assets/zh_api.md.9b1e7d12.lean.js +++ b/assets/zh_api.md.4eb83246.lean.js @@ -1 +1 @@ -import{_ as l,c as a,o as e,N as i}from"./chunks/framework.9a843496.js";const h=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"zh/api.md","lastUpdated":1685515852000}'),t={name:"zh/api.md"},r=i("",3),o=[r];function s(n,_,p,c,d,u){return e(),a("div",null,o)}const f=l(t,[["render",s]]);export{h as __pageData,f as default}; +import{_ as l,c as a,o as e,N as i}from"./chunks/framework.9a843496.js";const h=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"zh/api.md","lastUpdated":1685521513000}'),t={name:"zh/api.md"},r=i("",3),o=[r];function s(n,_,p,c,d,u){return e(),a("div",null,o)}const f=l(t,[["render",s]]);export{h as __pageData,f as default}; diff --git a/assets/zh_config.md.2cb97454.js b/assets/zh_config.md.4db86f5f.js similarity index 99% rename from assets/zh_config.md.2cb97454.js rename to assets/zh_config.md.4db86f5f.js index 4ddb857..d66a9be 100644 --- a/assets/zh_config.md.2cb97454.js +++ b/assets/zh_config.md.4db86f5f.js @@ -1,4 +1,4 @@ -import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"zh/config.md","lastUpdated":1685515852000}'),p={name:"zh/config.md"},o=l(`

配置

XCoin通过配置文件初始化机器人,包括以下几类配置文件

配置文件路径

config子文件夹

  • conf-base.js 基础配置

  • conf-secret.js 安全配置

  • conf-server.js 服务器配置

  • conf-future.js 期货基础配置

data/config 子文件夹

  • 存放所有用户设定的配置文件

  • 存放最后一次运行时的配置文件 last_config.json

配置文件可以通过客户端实时修改,部分核心参数的修改需要重新启动机器人,详情请参考 pm2管理机器人

配置文件加载流程

配置文件的加载过程如下

  1. 加载 初始配置文件,/config/conf-base.js获得所有初始配置

  2. 加载指定配置文件:命令行参数中--conf指定的配置文件并覆盖初始配置

  3. 加载上次使用配置文件 :如果--conf未指定配置文件但 /data/config/last_config.json存在,则加载last-config.json

  4. 加载命令行参数指定的配置,如用户作用yarn trade binance --paper --trade_type autoBuy,则paper=true与 trade_type='autoBuy'将成为首选配置

基础配置

基础配置文件位于/confg目录内,文件名为conf-base.js,配置参数按使用场景分为机器人,交易所、订单、卖点、模拟交易五个部分

javascript
{
+import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"zh/config.md","lastUpdated":1685521513000}'),p={name:"zh/config.md"},o=l(`

配置

XCoin通过配置文件初始化机器人,包括以下几类配置文件

配置文件路径

config子文件夹

  • conf-base.js 基础配置

  • conf-secret.js 安全配置

  • conf-server.js 服务器配置

  • conf-future.js 期货基础配置

data/config 子文件夹

  • 存放所有用户设定的配置文件

  • 存放最后一次运行时的配置文件 last_config.json

配置文件可以通过客户端实时修改,部分核心参数的修改需要重新启动机器人,详情请参考 pm2管理机器人

配置文件加载流程

配置文件的加载过程如下

  1. 加载 初始配置文件,/config/conf-base.js获得所有初始配置

  2. 加载指定配置文件:命令行参数中--conf指定的配置文件并覆盖初始配置

  3. 加载上次使用配置文件 :如果--conf未指定配置文件但 /data/config/last_config.json存在,则加载last-config.json

  4. 加载命令行参数指定的配置,如用户作用yarn trade binance --paper --trade_type autoBuy,则paper=true与 trade_type='autoBuy'将成为首选配置

基础配置

基础配置文件位于/confg目录内,文件名为conf-base.js,配置参数按使用场景分为机器人,交易所、订单、卖点、模拟交易五个部分

javascript
{
   bot: [//机器人配置
     {
       name: 'strategy',//策略
diff --git a/assets/zh_config.md.2cb97454.lean.js b/assets/zh_config.md.4db86f5f.lean.js
similarity index 82%
rename from assets/zh_config.md.2cb97454.lean.js
rename to assets/zh_config.md.4db86f5f.lean.js
index 117301c..8951941 100644
--- a/assets/zh_config.md.2cb97454.lean.js
+++ b/assets/zh_config.md.4db86f5f.lean.js
@@ -1 +1 @@
-import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"zh/config.md","lastUpdated":1685515852000}'),p={name:"zh/config.md"},o=l("",25),e=[o];function F(t,c,r,y,D,i){return a(),n("div",null,e)}const E=s(p,[["render",F]]);export{u as __pageData,E as default};
+import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"zh/config.md","lastUpdated":1685521513000}'),p={name:"zh/config.md"},o=l("",25),e=[o];function F(t,c,r,y,D,i){return a(),n("div",null,e)}const E=s(p,[["render",F]]);export{u as __pageData,E as default};
diff --git a/assets/zh_developer.md.1b57898c.js b/assets/zh_developer.md.135362c9.js
similarity index 97%
rename from assets/zh_developer.md.1b57898c.js
rename to assets/zh_developer.md.135362c9.js
index 0a155ad..40ba8d5 100644
--- a/assets/zh_developer.md.1b57898c.js
+++ b/assets/zh_developer.md.135362c9.js
@@ -1 +1 @@
-import{_ as e,c as t,o as a,N as s}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"开发者","description":"","frontmatter":{},"headers":[],"relativePath":"zh/developer.md","lastUpdated":1685515852000}'),n={name:"zh/developer.md"},o=s('

开发者

XCoin提供一些基础扩展来强化功能,开发者也可以通过扩展模块开发更多功能。

API扩展 /extensions/output

提供了XCoin与客户端连接的相关代码,目前XCoin仅支持 灵丹 相匹配的API,灵丹是一款全平台(ANDROID,IOS,WINDOWS,MAC,LINUX)交易机器人实时状态管理应用,与XCoin高度集成,能够提供所有配置,策略,实时交易的接口。

交易所扩展 /extensions/exchanges

交易所扩展提供了供机器人进行交易的数据来源,默认情况下使用ccxt提供的扩展,ccxt了提供大量的交易所数据接口,如果您需要开发某一交易所特定的接口,您可以在extensions下创建自己的交易所接口。

sim交易所是模拟交易的主接口,包括paper与sim两种模式,前者使用真实交易所数据进行模拟交易,后者使用历史数据回测交易。

您可以通过 交易所 获得更多帮助

策略扩展 /extensions/strategies

策略扩展提供了基于策略扩展的基础类 strategy.js及内置策略

策略扩展 /extensions/strategies/list

内置的策略列表,包含四种包含RSI的单独策略及一个复合策略,您可能轻松通过组合json文件获得新策略

您可以通过 交易策略 获得更多帮助

',13),i=[o];function r(h,p,c,l,d,x){return a(),t("div",null,i)}const g=e(n,[["render",r]]);export{u as __pageData,g as default}; +import{_ as e,c as t,o as a,N as s}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"开发者","description":"","frontmatter":{},"headers":[],"relativePath":"zh/developer.md","lastUpdated":1685521513000}'),n={name:"zh/developer.md"},o=s('

开发者

XCoin提供一些基础扩展来强化功能,开发者也可以通过扩展模块开发更多功能。

API扩展 /extensions/output

提供了XCoin与客户端连接的相关代码,目前XCoin仅支持 灵丹 相匹配的API,灵丹是一款全平台(ANDROID,IOS,WINDOWS,MAC,LINUX)交易机器人实时状态管理应用,与XCoin高度集成,能够提供所有配置,策略,实时交易的接口。

交易所扩展 /extensions/exchanges

交易所扩展提供了供机器人进行交易的数据来源,默认情况下使用ccxt提供的扩展,ccxt了提供大量的交易所数据接口,如果您需要开发某一交易所特定的接口,您可以在extensions下创建自己的交易所接口。

sim交易所是模拟交易的主接口,包括paper与sim两种模式,前者使用真实交易所数据进行模拟交易,后者使用历史数据回测交易。

您可以通过 交易所 获得更多帮助

策略扩展 /extensions/strategies

策略扩展提供了基于策略扩展的基础类 strategy.js及内置策略

策略扩展 /extensions/strategies/list

内置的策略列表,包含四种包含RSI的单独策略及一个复合策略,您可能轻松通过组合json文件获得新策略

您可以通过 交易策略 获得更多帮助

',13),i=[o];function r(h,p,c,l,d,x){return a(),t("div",null,i)}const g=e(n,[["render",r]]);export{u as __pageData,g as default}; diff --git a/assets/zh_developer.md.1b57898c.lean.js b/assets/zh_developer.md.135362c9.lean.js similarity index 83% rename from assets/zh_developer.md.1b57898c.lean.js rename to assets/zh_developer.md.135362c9.lean.js index 385237a..1cc414d 100644 --- a/assets/zh_developer.md.1b57898c.lean.js +++ b/assets/zh_developer.md.135362c9.lean.js @@ -1 +1 @@ -import{_ as e,c as t,o as a,N as s}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"开发者","description":"","frontmatter":{},"headers":[],"relativePath":"zh/developer.md","lastUpdated":1685515852000}'),n={name:"zh/developer.md"},o=s("",13),i=[o];function r(h,p,c,l,d,x){return a(),t("div",null,i)}const g=e(n,[["render",r]]);export{u as __pageData,g as default}; +import{_ as e,c as t,o as a,N as s}from"./chunks/framework.9a843496.js";const u=JSON.parse('{"title":"开发者","description":"","frontmatter":{},"headers":[],"relativePath":"zh/developer.md","lastUpdated":1685521513000}'),n={name:"zh/developer.md"},o=s("",13),i=[o];function r(h,p,c,l,d,x){return a(),t("div",null,i)}const g=e(n,[["render",r]]);export{u as __pageData,g as default}; diff --git a/assets/zh_exchange.md.0c7cc145.js b/assets/zh_exchange.md.60d49648.js similarity index 99% rename from assets/zh_exchange.md.0c7cc145.js rename to assets/zh_exchange.md.60d49648.js index fb28490..6ef1887 100644 --- a/assets/zh_exchange.md.0c7cc145.js +++ b/assets/zh_exchange.md.60d49648.js @@ -1,4 +1,4 @@ -import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const C=JSON.parse('{"title":"交易所","description":"","frontmatter":{},"headers":[],"relativePath":"zh/exchange.md","lastUpdated":1685515852000}'),o={name:"zh/exchange.md"},p=l(`

交易所

XCoin支持 ccxt 支持的所有交易所(超过100种),通过ccxt/exchange.js 的包装,能够处理几乎所有交易所需数据,目前我们已经测试通过的 Binance, BinanceUSDM,Mexc,您也可以试试其它交易所如OKEX,HuoBi等。 同时,在模拟或回测交易时,XCoin支持通过sim/exchange.js 获得历史或实时数据来完成模拟或回测交易流程 我们同时也在考虑添加一个基于pancakswap的DEFI类型的交易所,敬请期待.

现有交易所介绍

ccxt

支持通过 ccxt 模块获取数据的近百个主流交易所,通过用户提供的api key,交易所可通过匿名,用户认证,websocket认证三种模式获得数据,您可以根据需要便捷地进行调用

sim

模拟交易所,用于支持模拟与回测交易

添加新的交易所

XCoin通过如下方法初始化交易所

javascript
try {
+import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const C=JSON.parse('{"title":"交易所","description":"","frontmatter":{},"headers":[],"relativePath":"zh/exchange.md","lastUpdated":1685521513000}'),o={name:"zh/exchange.md"},p=l(`

交易所

XCoin支持 ccxt 支持的所有交易所(超过100种),通过ccxt/exchange.js 的包装,能够处理几乎所有交易所需数据,目前我们已经测试通过的 Binance, BinanceUSDM,Mexc,您也可以试试其它交易所如OKEX,HuoBi等。 同时,在模拟或回测交易时,XCoin支持通过sim/exchange.js 获得历史或实时数据来完成模拟或回测交易流程 我们同时也在考虑添加一个基于pancakswap的DEFI类型的交易所,敬请期待.

现有交易所介绍

ccxt

支持通过 ccxt 模块获取数据的近百个主流交易所,通过用户提供的api key,交易所可通过匿名,用户认证,websocket认证三种模式获得数据,您可以根据需要便捷地进行调用

sim

模拟交易所,用于支持模拟与回测交易

添加新的交易所

XCoin通过如下方法初始化交易所

javascript
try {
       if (so.mode !== 'live') {
         s.exchange = require(path.resolve(__dirname, '../extensions/exchanges/sim/exchange'))(conf, so, s)
       }
diff --git a/assets/zh_exchange.md.0c7cc145.lean.js b/assets/zh_exchange.md.60d49648.lean.js
similarity index 83%
rename from assets/zh_exchange.md.0c7cc145.lean.js
rename to assets/zh_exchange.md.60d49648.lean.js
index a1a1a07..ae7c1ed 100644
--- a/assets/zh_exchange.md.0c7cc145.lean.js
+++ b/assets/zh_exchange.md.60d49648.lean.js
@@ -1 +1 @@
-import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const C=JSON.parse('{"title":"交易所","description":"","frontmatter":{},"headers":[],"relativePath":"zh/exchange.md","lastUpdated":1685515852000}'),o={name:"zh/exchange.md"},p=l("",12),e=[p];function c(t,r,F,y,D,i){return n(),a("div",null,e)}const h=s(o,[["render",c]]);export{C as __pageData,h as default};
+import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const C=JSON.parse('{"title":"交易所","description":"","frontmatter":{},"headers":[],"relativePath":"zh/exchange.md","lastUpdated":1685521513000}'),o={name:"zh/exchange.md"},p=l("",12),e=[p];function c(t,r,F,y,D,i){return n(),a("div",null,e)}const h=s(o,[["render",c]]);export{C as __pageData,h as default};
diff --git a/assets/zh_faq.md.b5c01c15.js b/assets/zh_faq.md.38706051.js
similarity index 98%
rename from assets/zh_faq.md.b5c01c15.js
rename to assets/zh_faq.md.38706051.js
index b2fed13..b3b43c4 100644
--- a/assets/zh_faq.md.b5c01c15.js
+++ b/assets/zh_faq.md.38706051.js
@@ -1 +1 @@
-import{_ as a,c as e,o,N as i}from"./chunks/framework.9a843496.js";const f=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq.md","lastUpdated":1685515852000}'),r={name:"zh/faq.md"},t=i('

常见问题

以下是一些经常被问到的问题以及来自社区的回答。

如果您有此处未回答的问题,请随时在社区中提问,并建议将其放在此处。

谢谢!

问题

交易

答案

交易

我会用 XCoin 赚钱吗?

这取决于不同的配置和策略会产生不同的结果。

当前的默认配置和参数可能会让您赔钱,因此请谨慎行事。 首先尝试运行模拟和模拟交易以查看机器人的行为方式(请参阅下面的警告)。

为什么模拟、模拟交易和真实交易会产生不同的结果?

与真实交易相比,模拟和纸上交易几乎总是给出过于乐观的结果。 这是因为模拟和模拟交易都对何时/是否执行订单进行了假设。

由于 XCoin 默认使用限价订单(通常会减少费用),因此在实时交易中往往会有更多的滑点(机器人决定购买和实际购买之间的差异)。 因此,实时交易几乎总是比模拟交易和纸上交易差。

另外,请记住,过去的结果并不能保证未来的回报。

如果不能反映实时交易,我为什么要使用模拟或模拟交易?

模拟比纸上交易更乐观。 纸上交易比现场交易更乐观。 因此,如果模拟没有产生好的结果,很可能纸上交易或(推而广之)实时交易也不会。

XCoin 使用限价(制造商)订单还是市场(接受者)订单?

XCoin 默认使用限价单,因为在大多数交易所,限价单的费用低于市价单。 例如,在 GDAX 上,限价订单交易不收取任何费用,而市价订单的交易费用为 0.25%(BTC)或 0.3%(ETH 和 LTC)。

',20),n=[t];function h(l,c,d,s,p,_){return o(),e("div",null,n)}const q=a(r,[["render",h]]);export{f as __pageData,q as default}; +import{_ as a,c as e,o,N as i}from"./chunks/framework.9a843496.js";const f=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq.md","lastUpdated":1685521513000}'),r={name:"zh/faq.md"},t=i('

常见问题

以下是一些经常被问到的问题以及来自社区的回答。

如果您有此处未回答的问题,请随时在社区中提问,并建议将其放在此处。

谢谢!

问题

交易

答案

交易

我会用 XCoin 赚钱吗?

这取决于不同的配置和策略会产生不同的结果。

当前的默认配置和参数可能会让您赔钱,因此请谨慎行事。 首先尝试运行模拟和模拟交易以查看机器人的行为方式(请参阅下面的警告)。

为什么模拟、模拟交易和真实交易会产生不同的结果?

与真实交易相比,模拟和纸上交易几乎总是给出过于乐观的结果。 这是因为模拟和模拟交易都对何时/是否执行订单进行了假设。

由于 XCoin 默认使用限价订单(通常会减少费用),因此在实时交易中往往会有更多的滑点(机器人决定购买和实际购买之间的差异)。 因此,实时交易几乎总是比模拟交易和纸上交易差。

另外,请记住,过去的结果并不能保证未来的回报。

如果不能反映实时交易,我为什么要使用模拟或模拟交易?

模拟比纸上交易更乐观。 纸上交易比现场交易更乐观。 因此,如果模拟没有产生好的结果,很可能纸上交易或(推而广之)实时交易也不会。

XCoin 使用限价(制造商)订单还是市场(接受者)订单?

XCoin 默认使用限价单,因为在大多数交易所,限价单的费用低于市价单。 例如,在 GDAX 上,限价订单交易不收取任何费用,而市价订单的交易费用为 0.25%(BTC)或 0.3%(ETH 和 LTC)。

',20),n=[t];function h(l,c,d,s,p,_){return o(),e("div",null,n)}const q=a(r,[["render",h]]);export{f as __pageData,q as default}; diff --git a/assets/zh_faq.md.b5c01c15.lean.js b/assets/zh_faq.md.38706051.lean.js similarity index 82% rename from assets/zh_faq.md.b5c01c15.lean.js rename to assets/zh_faq.md.38706051.lean.js index 0ada0e0..a364977 100644 --- a/assets/zh_faq.md.b5c01c15.lean.js +++ b/assets/zh_faq.md.38706051.lean.js @@ -1 +1 @@ -import{_ as a,c as e,o,N as i}from"./chunks/framework.9a843496.js";const f=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq.md","lastUpdated":1685515852000}'),r={name:"zh/faq.md"},t=i("",20),n=[t];function h(l,c,d,s,p,_){return o(),e("div",null,n)}const q=a(r,[["render",h]]);export{f as __pageData,q as default}; +import{_ as a,c as e,o,N as i}from"./chunks/framework.9a843496.js";const f=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq.md","lastUpdated":1685521513000}'),r={name:"zh/faq.md"},t=i("",20),n=[t];function h(l,c,d,s,p,_){return o(),e("div",null,n)}const q=a(r,[["render",h]]);export{f as __pageData,q as default}; diff --git a/assets/zh_index.md.e44a0a62.js b/assets/zh_index.md.e01e624f.js similarity index 96% rename from assets/zh_index.md.e44a0a62.js rename to assets/zh_index.md.e01e624f.js index f6040a2..c59f65c 100644 --- a/assets/zh_index.md.e44a0a62.js +++ b/assets/zh_index.md.e01e624f.js @@ -1 +1 @@ -import{_ as t,c as e,o as i}from"./chunks/framework.9a843496.js";const h=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"XCoin","text":"下一代交易机器人","tagline":"基于Nodejs,简单而强大的数字资产交易机器人。","image":{"src":"/images/screenshot_cn.jpg","alt":"XCoin"},"actions":[{"theme":"brand","text":"快速开始","link":"/zh/start"},{"theme":"alt","text":"在 GitHub 上查看","link":"https://github.com/rainfu/xcoin"}]},"features":[{"title":"不限交易对","details":"支持同时交易多个交易对,只要服务器有足够算力,理论上你可以同时交易所有交易对。"},{"title":"不限交易所","details":"支持 ccxt 支持的所有交易所,轻松添加自定义交易所。"},{"title":"全新策略框架","details":"支持 technicalindicators 支持的所有交易策略,轻松通过JSON文件扩展新的策略。"},{"title":"支持多空交易","details":"支持期货交易并可控制是多空双方还是仅交易多方,空方。"},{"title":"四种交易模式","details":"支持多种交易方式,自动买,手动买,手动卖或完全手动模式。"},{"title":"监控池定制","details":"支持监控已购项目,支持黑名单,支持动态添加监控项目。"},{"title":"多机器人同时运行","details":"支持在单独线程上获取价格更新,支持同一机器同一交易所部署多个机器人。"},{"title":"支持模拟与回测交易","details":"支持真实交易,虚拟交易及对交易进行回测。"},{"title":"移动与桌面设备支持","details":"支持所有移动设备与桌面设备,实时控制机器人的全部状态与操作"}]},"headers":[],"relativePath":"zh/index.md","lastUpdated":1685515852000}'),a={name:"zh/index.md"};function s(l,n,o,c,d,r){return i(),e("div")}const p=t(a,[["render",s]]);export{h as __pageData,p as default}; +import{_ as t,c as e,o as i}from"./chunks/framework.9a843496.js";const h=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"XCoin","text":"下一代交易机器人","tagline":"基于Nodejs,简单而强大的数字资产交易机器人。","image":{"src":"/images/screenshot_cn.jpg","alt":"XCoin"},"actions":[{"theme":"brand","text":"快速开始","link":"/zh/start"},{"theme":"alt","text":"在 GitHub 上查看","link":"https://github.com/rainfu/xcoin"}]},"features":[{"title":"不限交易对","details":"支持同时交易多个交易对,只要服务器有足够算力,理论上你可以同时交易所有交易对。"},{"title":"不限交易所","details":"支持 ccxt 支持的所有交易所,轻松添加自定义交易所。"},{"title":"全新策略框架","details":"支持 technicalindicators 支持的所有交易策略,轻松通过JSON文件扩展新的策略。"},{"title":"支持多空交易","details":"支持期货交易并可控制是多空双方还是仅交易多方,空方。"},{"title":"四种交易模式","details":"支持多种交易方式,自动买,手动买,手动卖或完全手动模式。"},{"title":"监控池定制","details":"支持监控已购项目,支持黑名单,支持动态添加监控项目。"},{"title":"多机器人同时运行","details":"支持在单独线程上获取价格更新,支持同一机器同一交易所部署多个机器人。"},{"title":"支持模拟与回测交易","details":"支持真实交易,虚拟交易及对交易进行回测。"},{"title":"移动与桌面设备支持","details":"支持所有移动设备与桌面设备,实时控制机器人的全部状态与操作"}]},"headers":[],"relativePath":"zh/index.md","lastUpdated":1685521513000}'),a={name:"zh/index.md"};function s(l,n,o,c,d,r){return i(),e("div")}const p=t(a,[["render",s]]);export{h as __pageData,p as default}; diff --git a/assets/zh_index.md.e44a0a62.lean.js b/assets/zh_index.md.e01e624f.lean.js similarity index 96% rename from assets/zh_index.md.e44a0a62.lean.js rename to assets/zh_index.md.e01e624f.lean.js index f6040a2..c59f65c 100644 --- a/assets/zh_index.md.e44a0a62.lean.js +++ b/assets/zh_index.md.e01e624f.lean.js @@ -1 +1 @@ -import{_ as t,c as e,o as i}from"./chunks/framework.9a843496.js";const h=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"XCoin","text":"下一代交易机器人","tagline":"基于Nodejs,简单而强大的数字资产交易机器人。","image":{"src":"/images/screenshot_cn.jpg","alt":"XCoin"},"actions":[{"theme":"brand","text":"快速开始","link":"/zh/start"},{"theme":"alt","text":"在 GitHub 上查看","link":"https://github.com/rainfu/xcoin"}]},"features":[{"title":"不限交易对","details":"支持同时交易多个交易对,只要服务器有足够算力,理论上你可以同时交易所有交易对。"},{"title":"不限交易所","details":"支持 ccxt 支持的所有交易所,轻松添加自定义交易所。"},{"title":"全新策略框架","details":"支持 technicalindicators 支持的所有交易策略,轻松通过JSON文件扩展新的策略。"},{"title":"支持多空交易","details":"支持期货交易并可控制是多空双方还是仅交易多方,空方。"},{"title":"四种交易模式","details":"支持多种交易方式,自动买,手动买,手动卖或完全手动模式。"},{"title":"监控池定制","details":"支持监控已购项目,支持黑名单,支持动态添加监控项目。"},{"title":"多机器人同时运行","details":"支持在单独线程上获取价格更新,支持同一机器同一交易所部署多个机器人。"},{"title":"支持模拟与回测交易","details":"支持真实交易,虚拟交易及对交易进行回测。"},{"title":"移动与桌面设备支持","details":"支持所有移动设备与桌面设备,实时控制机器人的全部状态与操作"}]},"headers":[],"relativePath":"zh/index.md","lastUpdated":1685515852000}'),a={name:"zh/index.md"};function s(l,n,o,c,d,r){return i(),e("div")}const p=t(a,[["render",s]]);export{h as __pageData,p as default}; +import{_ as t,c as e,o as i}from"./chunks/framework.9a843496.js";const h=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"XCoin","text":"下一代交易机器人","tagline":"基于Nodejs,简单而强大的数字资产交易机器人。","image":{"src":"/images/screenshot_cn.jpg","alt":"XCoin"},"actions":[{"theme":"brand","text":"快速开始","link":"/zh/start"},{"theme":"alt","text":"在 GitHub 上查看","link":"https://github.com/rainfu/xcoin"}]},"features":[{"title":"不限交易对","details":"支持同时交易多个交易对,只要服务器有足够算力,理论上你可以同时交易所有交易对。"},{"title":"不限交易所","details":"支持 ccxt 支持的所有交易所,轻松添加自定义交易所。"},{"title":"全新策略框架","details":"支持 technicalindicators 支持的所有交易策略,轻松通过JSON文件扩展新的策略。"},{"title":"支持多空交易","details":"支持期货交易并可控制是多空双方还是仅交易多方,空方。"},{"title":"四种交易模式","details":"支持多种交易方式,自动买,手动买,手动卖或完全手动模式。"},{"title":"监控池定制","details":"支持监控已购项目,支持黑名单,支持动态添加监控项目。"},{"title":"多机器人同时运行","details":"支持在单独线程上获取价格更新,支持同一机器同一交易所部署多个机器人。"},{"title":"支持模拟与回测交易","details":"支持真实交易,虚拟交易及对交易进行回测。"},{"title":"移动与桌面设备支持","details":"支持所有移动设备与桌面设备,实时控制机器人的全部状态与操作"}]},"headers":[],"relativePath":"zh/index.md","lastUpdated":1685521513000}'),a={name:"zh/index.md"};function s(l,n,o,c,d,r){return i(),e("div")}const p=t(a,[["render",s]]);export{h as __pageData,p as default}; diff --git a/assets/zh_pm2.md.7bb1c756.js b/assets/zh_pm2.md.3c4bfefd.js similarity index 99% rename from assets/zh_pm2.md.7bb1c756.js rename to assets/zh_pm2.md.3c4bfefd.js index 3e7f1be..bbd186e 100644 --- a/assets/zh_pm2.md.7bb1c756.js +++ b/assets/zh_pm2.md.3c4bfefd.js @@ -1,4 +1,4 @@ -import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const A=JSON.parse('{"title":"使用PM2管理机器人","description":"","frontmatter":{},"headers":[],"relativePath":"zh/pm2.md","lastUpdated":1685515852000}'),p={name:"zh/pm2.md"},o=l(`

使用PM2管理机器人

XCoin建议您通过pm2管理您的机器人,通过pm2您可以

  • 保证主线程持续运行
  • 方便地同时启动主线程与价格更新线程
  • 方便地在参数变化时重新启动线程 缺点:如果使用pm2启动线程,部分键盘事件可能无法在服务器端使用

安装 pm2

bash
yarn global add pm2

如何使用

假设您需要通过pm2管理一个使用币安期货进行交易的机器人组,组内包含两个机器人,一个数据更新线程。您需要

  1. 在/config/下建立一个binanceusdm.config.js的文件
javascript
module.exports = {
+import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const A=JSON.parse('{"title":"使用PM2管理机器人","description":"","frontmatter":{},"headers":[],"relativePath":"zh/pm2.md","lastUpdated":1685521513000}'),p={name:"zh/pm2.md"},o=l(`

使用PM2管理机器人

XCoin建议您通过pm2管理您的机器人,通过pm2您可以

  • 保证主线程持续运行
  • 方便地同时启动主线程与价格更新线程
  • 方便地在参数变化时重新启动线程 缺点:如果使用pm2启动线程,部分键盘事件可能无法在服务器端使用

安装 pm2

bash
yarn global add pm2

如何使用

假设您需要通过pm2管理一个使用币安期货进行交易的机器人组,组内包含两个机器人,一个数据更新线程。您需要

  1. 在/config/下建立一个binanceusdm.config.js的文件
javascript
module.exports = {
   apps: [
     {
       name: 'server',//价格更新
diff --git a/assets/zh_pm2.md.7bb1c756.lean.js b/assets/zh_pm2.md.3c4bfefd.lean.js
similarity index 83%
rename from assets/zh_pm2.md.7bb1c756.lean.js
rename to assets/zh_pm2.md.3c4bfefd.lean.js
index 3e0cc72..50ac758 100644
--- a/assets/zh_pm2.md.7bb1c756.lean.js
+++ b/assets/zh_pm2.md.3c4bfefd.lean.js
@@ -1 +1 @@
-import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const A=JSON.parse('{"title":"使用PM2管理机器人","description":"","frontmatter":{},"headers":[],"relativePath":"zh/pm2.md","lastUpdated":1685515852000}'),p={name:"zh/pm2.md"},o=l("",13),e=[o];function t(c,r,D,y,F,i){return n(),a("div",null,e)}const d=s(p,[["render",t]]);export{A as __pageData,d as default};
+import{_ as s,c as a,o as n,N as l}from"./chunks/framework.9a843496.js";const A=JSON.parse('{"title":"使用PM2管理机器人","description":"","frontmatter":{},"headers":[],"relativePath":"zh/pm2.md","lastUpdated":1685521513000}'),p={name:"zh/pm2.md"},o=l("",13),e=[o];function t(c,r,D,y,F,i){return n(),a("div",null,e)}const d=s(p,[["render",t]]);export{A as __pageData,d as default};
diff --git a/assets/zh_start.md.eca26e77.js b/assets/zh_start.md.7236027f.js
similarity index 99%
rename from assets/zh_start.md.eca26e77.js
rename to assets/zh_start.md.7236027f.js
index 8aa36a6..be5685e 100644
--- a/assets/zh_start.md.eca26e77.js
+++ b/assets/zh_start.md.7236027f.js
@@ -1,4 +1,4 @@
-import{_ as s,c as a,o as n,N as e}from"./chunks/framework.9a843496.js";const D=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"zh/start.md","lastUpdated":1685515852000}'),l={name:"zh/start.md"},o=e(`

快速开始

第一步 需求

  • Windows / Linux / macOS 10 (or Docker)
  • Node.js (version 12.0.0 or higher) and MongoDB.

第二步 安装

在终端中运行,

bash
git clone https://github.com/rainfu/xcoin.git

或者,直接下载,

bash
wget https://github.com/rainfu/xcoin/archive/master.tar.gz
+import{_ as s,c as a,o as n,N as e}from"./chunks/framework.9a843496.js";const D=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"zh/start.md","lastUpdated":1685521513000}'),l={name:"zh/start.md"},o=e(`

快速开始

第一步 需求

  • Windows / Linux / macOS 10 (or Docker)
  • Node.js (version 12.0.0 or higher) and MongoDB.

第二步 安装

在终端中运行,

bash
git clone https://github.com/rainfu/xcoin.git

或者,直接下载,

bash
wget https://github.com/rainfu/xcoin/archive/master.tar.gz
 tar -xf master.tar.gz
 mv xcoin-master xcoin

创建您的安全配置文件 config/conf-secret-sample.js to config/conf-secret.js:

bash
cp conf--secret-sample.js conf.js
  • 添加数据库,第三方交易所API等必要数据,安全已见,请不要在第三方API中提供转账功能
  • 查看与编辑 conf-base.js以满足您的交易习惯.
  • 查看与编辑 conf-future.js 以满足您的期货交易习惯.
  • 如果您需要使用独立的价格更新线程,请修改conf-server.js
  • 如果您需要使用 PM2 来管理您的线程,请查看或编辑 binane.config.js

初始化项目:

bash
cd xcoin
 yarn

一些常见的命令

获得帮助:

bash
node ./xcoin --help

列出所有的交易策略:

bash
node ./xcoin strategies

获得某一交易所您的资产

bash
node ./xcoin exchange binance --balance

运行XCoin

下面命令将模拟交易币安交易所的BTC与ETH两个交易对.

bash
node ./xcoin trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper

您也可以直接使用yarn 命令,两者效果相同

bash
yarn trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper

使用 --paper 标识来决定是真实交易还是模拟交易.

使用 --trade_type 标识来确认交易机器人进行交易的方式 ,包括

  • auto 自动买卖

  • autoBuy 自动买

  • autoSell 自动卖

  • manual 手动

使用 --conf 标识来确认交易机器人使用的配置文件,该配置文件将覆盖 conf-base.js配置文件

下列命令将交易指定配置文件下的设置

bash
yarn trade binance --conf ./data/config/binance/30mf.json

更多命令行可带交易参数请查看 commands/trade.js 文件,所有交易参考均可直接在config文件中设定

bash
yarn trade --help
`,33),p=[o];function t(c,r,i,C,d,y){return n(),a("div",null,p)}const A=s(l,[["render",t]]);export{D as __pageData,A as default}; diff --git a/assets/zh_start.md.eca26e77.lean.js b/assets/zh_start.md.7236027f.lean.js similarity index 83% rename from assets/zh_start.md.eca26e77.lean.js rename to assets/zh_start.md.7236027f.lean.js index 8af2613..be8c2c7 100644 --- a/assets/zh_start.md.eca26e77.lean.js +++ b/assets/zh_start.md.7236027f.lean.js @@ -1 +1 @@ -import{_ as s,c as a,o as n,N as e}from"./chunks/framework.9a843496.js";const D=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"zh/start.md","lastUpdated":1685515852000}'),l={name:"zh/start.md"},o=e("",33),p=[o];function t(c,r,i,C,d,y){return n(),a("div",null,p)}const A=s(l,[["render",t]]);export{D as __pageData,A as default}; +import{_ as s,c as a,o as n,N as e}from"./chunks/framework.9a843496.js";const D=JSON.parse('{"title":"快速开始","description":"","frontmatter":{},"headers":[],"relativePath":"zh/start.md","lastUpdated":1685521513000}'),l={name:"zh/start.md"},o=e("",33),p=[o];function t(c,r,i,C,d,y){return n(),a("div",null,p)}const A=s(l,[["render",t]]);export{D as __pageData,A as default}; diff --git a/assets/zh_strategy.md.c37ef5d2.js b/assets/zh_strategy.md.242ac32d.js similarity index 99% rename from assets/zh_strategy.md.c37ef5d2.js rename to assets/zh_strategy.md.242ac32d.js index 82552a2..cfe52e8 100644 --- a/assets/zh_strategy.md.c37ef5d2.js +++ b/assets/zh_strategy.md.242ac32d.js @@ -1,4 +1,4 @@ -import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const q=JSON.parse('{"title":"策略","description":"","frontmatter":{},"headers":[],"relativePath":"zh/strategy.md","lastUpdated":1685515852000}'),o={name:"zh/strategy.md"},p=l(`

策略

XCoin使用一种全新的方式让您可以轻松管理理解策略,管理策略并创建您自己的策略文件 并通过运行主程序方便地测试它们。 XCoin使用 technicalindicators 库作为策略基础运算库,包含K线识别库与其它一些常见的策略逻辑。

目前XCoin提供了包含K线识别库在内的5个基础策略库,理论上,您可以无需编码,通过添加JSON文件即可运行所有数十种基础策略与无限种组合策略。

如果您希望快速建立策略文件,您可以

  • 理解策略类 strategy.js的运行逻辑

  • 熟悉系统策略json文件

  • 创建您自己的系统策略或组合策略文件

  • 可视化地建立组合策略文件

策略类的运行逻辑

XCoin主程序在运行过程中与策略文件的交互关系,通过交互获得交易信号进行交易

  • 初始化时加载策略文件初始化策略

  • 通过预加载K线周期获得策略需要的预加载的数据

  • 在主程序每次轮询时与策略交互

    • 传递实时K线数据获得策略输出值(calculate)

    • 通过策略输出值计算是否触发交易信号(onPeriod)

    • 数据在终端容器或客户端显示形式(onReport)

K线数据根据策略数据实时更新,所以交易信号为实时K线信号提供,在K线数据中包含买卖信号及数值。每条K线的数据如下所示

javascript
{
+import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const q=JSON.parse('{"title":"策略","description":"","frontmatter":{},"headers":[],"relativePath":"zh/strategy.md","lastUpdated":1685521513000}'),o={name:"zh/strategy.md"},p=l(`

策略

XCoin使用一种全新的方式让您可以轻松管理理解策略,管理策略并创建您自己的策略文件 并通过运行主程序方便地测试它们。 XCoin使用 technicalindicators 库作为策略基础运算库,包含K线识别库与其它一些常见的策略逻辑。

目前XCoin提供了包含K线识别库在内的5个基础策略库,理论上,您可以无需编码,通过添加JSON文件即可运行所有数十种基础策略与无限种组合策略。

如果您希望快速建立策略文件,您可以

  • 理解策略类 strategy.js的运行逻辑

  • 熟悉系统策略json文件

  • 创建您自己的系统策略或组合策略文件

  • 可视化地建立组合策略文件

策略类的运行逻辑

XCoin主程序在运行过程中与策略文件的交互关系,通过交互获得交易信号进行交易

  • 初始化时加载策略文件初始化策略

  • 通过预加载K线周期获得策略需要的预加载的数据

  • 在主程序每次轮询时与策略交互

    • 传递实时K线数据获得策略输出值(calculate)

    • 通过策略输出值计算是否触发交易信号(onPeriod)

    • 数据在终端容器或客户端显示形式(onReport)

K线数据根据策略数据实时更新,所以交易信号为实时K线信号提供,在K线数据中包含买卖信号及数值。每条K线的数据如下所示

javascript
{
     "period_id": "2h233427",
     "size": "2h",
     "time": 1680674400000,
diff --git a/assets/zh_strategy.md.c37ef5d2.lean.js b/assets/zh_strategy.md.242ac32d.lean.js
similarity index 83%
rename from assets/zh_strategy.md.c37ef5d2.lean.js
rename to assets/zh_strategy.md.242ac32d.lean.js
index 5a0443d..af20268 100644
--- a/assets/zh_strategy.md.c37ef5d2.lean.js
+++ b/assets/zh_strategy.md.242ac32d.lean.js
@@ -1 +1 @@
-import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const q=JSON.parse('{"title":"策略","description":"","frontmatter":{},"headers":[],"relativePath":"zh/strategy.md","lastUpdated":1685515852000}'),o={name:"zh/strategy.md"},p=l("",18),t=[p];function e(F,c,r,D,y,i){return a(),n("div",null,t)}const C=s(o,[["render",e]]);export{q as __pageData,C as default};
+import{_ as s,c as n,o as a,N as l}from"./chunks/framework.9a843496.js";const q=JSON.parse('{"title":"策略","description":"","frontmatter":{},"headers":[],"relativePath":"zh/strategy.md","lastUpdated":1685521513000}'),o={name:"zh/strategy.md"},p=l("",18),t=[p];function e(F,c,r,D,y,i){return a(),n("div",null,t)}const C=s(o,[["render",e]]);export{q as __pageData,C as default};
diff --git a/config.html b/config.html
index 1a84017..8d4af2e 100644
--- a/config.html
+++ b/config.html
@@ -10,7 +10,7 @@
     
   
   
-  
+  
   
   
   
@@ -482,8 +482,8 @@
          port: 17810,//The port of the price thread
          save_pairs: "binanceusdm.BTC-USDT,binanceusdm.DOGE-USDT"//Trading pairs saved in real time, use all to save all, mainly for backtesting
      }
-}

Released under the MIT License

- diff --git a/developer.html b/developer.html index d5b1645..8efa19d 100644 --- a/developer.html +++ b/developer.html @@ -10,12 +10,12 @@ - + -
Skip to content
On this page

Developer

XCoin provides some basic extensions to enhance functions, and developers can also develop more functions through extension modules.

API extensions /extensions/output

The relevant codes for connecting XCoin to the client are provided. At present, XCoin only supports APIs matching Panacea. Panacea is a full-platform (ANDROID, IOS, WINDOWS, MAC, LINUX) trading bot real-time status management application, which is highly compatible with XCoin Integration, can provide interfaces for all configurations, strategies, and real-time trading.

You can get more help at API

Exchange Extensions /extensions/exchanges

The exchange extension provides the data source for the bot to trade. By default, the extension provided by ccxt is used. ccxt provides a large number of exchange data interfaces. If you need to develop an exchange-specific interface, you can create it under extensions Own exchange interface.

The sim exchange is the main interface for simulated trading, including paper and sim. The former uses real exchange data for simulated trading, and the latter uses historical data for backtesting transactions.

You can get more help at exchangse

Strategy Extensions /extensions/strategies

Strategy extension provides the base class strategy.js and built-in strategy based on strategy extension

Strategy extensions /extensions/strategies/list

The built-in strategy list includes four separate strategies including RSI and a compound strategy. You may easily obtain new strategies by combining json files

You can get more help with Trading Strategies

Released under the MIT License

- diff --git a/exchange.html b/exchange.html index 5dcc576..28e932b 100644 --- a/exchange.html +++ b/exchange.html @@ -10,7 +10,7 @@ - + @@ -23,8 +23,8 @@ } } catch (e) { s.exchange = require(path.resolve(__dirname, '../extensions/exchanges/ccxt/exchange'))(conf, so) - }

If ccxt/exchange.js does not meet your requirements, you can add a new exchange name under extensions/exchange and add the exchange.js file under exchanges

  • If the exchange is based on ccxt, you only need to adjust the details part

  • If the exchange is based on other APIs, you need to implement the necessary functions provided by the CCXT exchange

- diff --git a/faq.html b/faq.html index b808aca..5ce377f 100644 --- a/faq.html +++ b/faq.html @@ -10,12 +10,12 @@ - + -
Skip to content
On this page

FAQ

Here are some frequently asked questions and responses from the community.

If you have a question that isn't answered here, please ask it in the community

Thanks!

Question

Trading

Answer

Trading

Will I make money with XCoin?

That depends… Different configurations and strategies will yield different results.

The current default config and parameters will likely lose you money, so proceed with caution. Try running simulations and paper trading first to see how the bot acts (see warning below).

Why do simulations, paper trading, and live trading all yield different results?

Simulations and paper trading almost always give overly optimistic results compared to live trading. This is because simulations and paper trading both make assumptions about when/if an order is filled.

Because XCoin defaults to using Limit orders (which often lessen fees), there tends to be much more slippage (the difference between when the bot decides to buy and when it actually buys) in live trading. Due to this, live trading is almost always worse than sims and paper trading.

Also, remember that past results do not guarantee future returns.

Why should I use simulations or paper trading if they do not reflect live trading?

Simulations are more optimistic than paper trading. Paper trading is more optimistic than live trading. Therefore, if a simulation does not yield good results, odds are that neither will paper trading or (by extension) live trading.

Does XCoin use Limit (maker) orders or Market (taker) orders?

XCoin uses Limit orders by default because on most exchanges, Limit orders result in lower fees than Market orders. For instance, on GDAX there is no fee for a Limit order trade compared to a 0.25% (BTC) or 0.3% (ETH & LTC) trade fee on a Market order.

Released under the MIT License

- diff --git a/hashmap.json b/hashmap.json index 4e573eb..1a8b004 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"zh_faq.md":"b5c01c15","zh_index.md":"e44a0a62","zh_pm2.md":"7bb1c756","zh_start.md":"eca26e77","zh_strategy.md":"c37ef5d2","config.md":"24bf3995","developer.md":"f736e55d","exchange.md":"368a3ea4","faq.md":"bd3b202b","zh_exchange.md":"0c7cc145","zh_developer.md":"1b57898c","api.md":"5bcff37c","zh_readme.md":"1b2c4e67","index.md":"1c1c2e14","zh_api.md":"9b1e7d12","start.md":"c4781097","strategy.md":"d3fef1f4","zh_config.md":"2cb97454","readme.md":"774d846d","pm2.md":"900932fa"} +{"zh_strategy.md":"242ac32d","api.md":"1ad43746","readme.md":"2de6eb80","zh_pm2.md":"3c4bfefd","developer.md":"bf9c8192","zh_index.md":"e01e624f","zh_start.md":"7236027f","faq.md":"6a07f812","pm2.md":"3c6fe67c","zh_api.md":"4eb83246","index.md":"4bd7b1ab","zh_exchange.md":"60d49648","start.md":"3c3bf4c4","strategy.md":"e8847b69","zh_config.md":"4db86f5f","zh_faq.md":"38706051","zh_readme.md":"0a0a0a63","config.md":"87c1437e","zh_developer.md":"135362c9","exchange.md":"1a30b858"} diff --git a/index.html b/index.html index d2c8f4f..2b1acfc 100644 --- a/index.html +++ b/index.html @@ -10,12 +10,12 @@ - +
Skip to content

XCoin

Next Gerneration Trading Bot

A Simple and Powerful Trading Robot Based on Nodejs.

XCoin

Unlimited trading pairs

Support trading multiple trading pairs at the same time, you can trade all pairs at the same time.

Unlimited exchanges

Support all exchanges supported by ccxt, easily add custom exchanges.

New Strategy Framework

Support all trading strategies supported by technicalindicators, and easily extend new strategies through JSON files.

Support long and short trading

Supports futures trading and can control whether it is long or short or both trading.

Four trading modes

Support multiple trading methods, automatic buying, manual buying, manual selling or full manual.

Watch Pool Customization

Supports Watching of purchased items, blacklist, and dynamic addition of watch items.

Multiple bots running at the same time

Supports obtaining price updates on a separate thread, and supports deploying multiple bots on the same machine.

Support simulation and backtest

Supports real trade, virtual trade and backtesting.

Mobile and Desktop Support

Support all mobile devices and desktop devices, real-time control of all states and operations of the robot

Released under the MIT License

- diff --git a/pm2.html b/pm2.html index b98f6d1..0476781 100644 --- a/pm2.html +++ b/pm2.html @@ -10,7 +10,7 @@ - + @@ -41,8 +41,8 @@ console.log('\nSome Core Param changed.should restart process...'.orange) var target3 = require('path').resolve(__dirname, '../../data/pm2/restart_' + s.options.exchange + "_" + (s.options.name || '') + '.json') require('fs').writeFileSync(target3, JSON.stringify({ event: 'updateConfig', time: moment().format('MMDD HH:mm:ss') }, null, 2)) - }

Running multiple bots on different exchanges

If you want to run multiple bots based on different exchanges through pm2, you only need to repeat the above steps, such as trading matcha products through yarn mexc. Notice

- diff --git a/start.html b/start.html index 5cb13c0..596d2ad 100644 --- a/start.html +++ b/start.html @@ -10,15 +10,15 @@ - +
Skip to content
On this page

Quick Start

Setp 1 Requirements

  • Windows / Linux / macOS 10 (or Docker)
  • Node.js (version 12.0.0 or higher) and MongoDB.

Setp 2 Install

run in terminal,

bash
git clone https://github.com/rainfu/xcoin.git

Or, to download directly,

bash
wget https://github.com/rainfu/xcoin/archive/master.tar.gz
 tar -xf master.tar.gz
 mv xcoin-master xcoin

Create your security configuration file config/conf-secret-sample.js to config/conf-secret.js:

bash
cp conf --secret-sample.js conf.js
  • Add database, third-party exchange API and other necessary data, security has been seen, please do not provide transfer function in third-party API
  • View and edit conf-base.js to suit your trading habits.
  • View and edit conf-future.js to suit your futures trading habits.
  • If you need to use a separate price update thread, please modify conf-server.js
  • If you need to use PM2 to manage your threads, please view or edit binane.config.js

Initialize the project:

bash
cd xcoin
-yarn

Some common commands

Get help:

bash
node ./xcoin --help

List all trading strategies:

bash
node ./xcoin strategies

Get your assets on an exchange

bash
node ./xcoin exchange binance --balance

Run XCoin

The following command will simulate two trading pairs of BTC and ETH on Binance Exchange.

bash
node ./xcoin trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper

You can also use the yarn command directly, both have the same effect

bash
yarn trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper

Use the --paper flag to decide whether to trade live or paper.

Use the --trade_type flag to identify how the trading bot will trade, including

  • auto automatic trading

  • autoBuy buy automatically

  • autoSell automatically sell

  • manual

Use the --conf flag to identify the configuration file used by the trading robot, which will override the conf-base.js configuration file

The following command will trade the settings under the specified configuration file

bash
yarn trade binance --conf ./data/config/binance/30mf.json

For more transaction parameters that can be brought by the command line, please refer to the commands/trade.js file. All transaction references can be set directly in the config file

bash
yarn trade --help

Released under the MIT License

- diff --git a/strategy.html b/strategy.html index 66b7871..c6b2336 100644 --- a/strategy.html +++ b/strategy.html @@ -10,7 +10,7 @@ - + @@ -135,8 +135,8 @@ } } ] -}

strategy types provided by the system

At present, the system provides the following strategies, among which the CUSTOM strategy is a free combination strategy, and the other strategies are all strategies combined with RSI. They are located in the /extensions/strategies/list directory, the technicalindicators library provides most of the currently available trading strategies, and you can add new strategies to the system or user strategies at any time.

Create your own strategy

If you want to combine the existing strategies, please create a new json file in /data/strategies, and add the system strategy you want to use in the strategies, you can use one, two or any Strategies, pay attention to handle the cooperative relationship (connect type) between strategies.

If you want to extend the existing system strategy, please understand the technicalindicators library, understand the operation logic of the strategy.js strategy file, add a new json file in /extensions/strategies/list and set the parameters. You can check if the strategy is spoken and displayed correctly at any time by running trade.js

- diff --git a/zh/README.html b/zh/README.html index f739fa7..d6a886f 100644 --- a/zh/README.html +++ b/zh/README.html @@ -10,12 +10,12 @@ - + -
Skip to content

MIT 授权

- diff --git a/zh/api.html b/zh/api.html index a6d2b89..5decd0f 100644 --- a/zh/api.html +++ b/zh/api.html @@ -10,12 +10,12 @@ - + -
Skip to content
在此页

API

XCoin为客户端程序提供一套统一的API,通过API提供以下几个方面的信息

  • status 提供当前交易机器人的运行状态
    • getInitData 获得机器人初始化数据
    • refreshData 获得机器人实时交易数据
  • operation 提供与当前交易机器人进行的交互操作,如买卖或更新交易对等
    • bug 买入多或空
    • sell 卖出多或空
    • sellAll 清仓
    • addSymbol 将交易对添加至监控池
    • removeAllSymbol 清空监控池
    • removeSymbol 从监控池移除交易对
    • updateConfig 更新机器人设置
    • updateSymbolFuture 更新期货相关设置,如杠杆
  • market 提供当前交易机器人对应的交易所的相关操作,如获得产品,报价等
  • backtest 提供回测相关数据
  • panacea 提供 灵丹 客户端相关内容

MIT 授权

- diff --git a/zh/config.html b/zh/config.html index 19e938c..0079e75 100644 --- a/zh/config.html +++ b/zh/config.html @@ -10,7 +10,7 @@ - + @@ -482,8 +482,8 @@ port: 17810,//价格线程的端口 save_pairs: "binanceusdm.BTC-USDT,binanceusdm.DOGE-USDT"//实时保存的交易对,使用all全部保存,主要用于回测 } -} - diff --git a/zh/developer.html b/zh/developer.html index 1755954..50e81a0 100644 --- a/zh/developer.html +++ b/zh/developer.html @@ -10,12 +10,12 @@ - + -
Skip to content
在此页

开发者

XCoin提供一些基础扩展来强化功能,开发者也可以通过扩展模块开发更多功能。

API扩展 /extensions/output

提供了XCoin与客户端连接的相关代码,目前XCoin仅支持 灵丹 相匹配的API,灵丹是一款全平台(ANDROID,IOS,WINDOWS,MAC,LINUX)交易机器人实时状态管理应用,与XCoin高度集成,能够提供所有配置,策略,实时交易的接口。

交易所扩展 /extensions/exchanges

交易所扩展提供了供机器人进行交易的数据来源,默认情况下使用ccxt提供的扩展,ccxt了提供大量的交易所数据接口,如果您需要开发某一交易所特定的接口,您可以在extensions下创建自己的交易所接口。

sim交易所是模拟交易的主接口,包括paper与sim两种模式,前者使用真实交易所数据进行模拟交易,后者使用历史数据回测交易。

您可以通过 交易所 获得更多帮助

策略扩展 /extensions/strategies

策略扩展提供了基于策略扩展的基础类 strategy.js及内置策略

策略扩展 /extensions/strategies/list

内置的策略列表,包含四种包含RSI的单独策略及一个复合策略,您可能轻松通过组合json文件获得新策略

您可以通过 交易策略 获得更多帮助

MIT 授权

- diff --git a/zh/exchange.html b/zh/exchange.html index 2763380..115e623 100644 --- a/zh/exchange.html +++ b/zh/exchange.html @@ -10,7 +10,7 @@ - + @@ -23,8 +23,8 @@ } } catch (e) { s.exchange = require(path.resolve(__dirname, '../extensions/exchanges/ccxt/exchange'))(conf, so) - }

如果ccxt/exchange.js不符合您的要求,您可以在 extensions/exchange下添加新的交易所名称,并在交易所下添加exchange.js文件

- diff --git a/zh/faq.html b/zh/faq.html index ab8d001..e2c65ea 100644 --- a/zh/faq.html +++ b/zh/faq.html @@ -10,12 +10,12 @@ - + -
Skip to content
在此页

常见问题

以下是一些经常被问到的问题以及来自社区的回答。

如果您有此处未回答的问题,请随时在社区中提问,并建议将其放在此处。

谢谢!

问题

交易

答案

交易

我会用 XCoin 赚钱吗?

这取决于不同的配置和策略会产生不同的结果。

当前的默认配置和参数可能会让您赔钱,因此请谨慎行事。 首先尝试运行模拟和模拟交易以查看机器人的行为方式(请参阅下面的警告)。

为什么模拟、模拟交易和真实交易会产生不同的结果?

与真实交易相比,模拟和纸上交易几乎总是给出过于乐观的结果。 这是因为模拟和模拟交易都对何时/是否执行订单进行了假设。

由于 XCoin 默认使用限价订单(通常会减少费用),因此在实时交易中往往会有更多的滑点(机器人决定购买和实际购买之间的差异)。 因此,实时交易几乎总是比模拟交易和纸上交易差。

另外,请记住,过去的结果并不能保证未来的回报。

如果不能反映实时交易,我为什么要使用模拟或模拟交易?

模拟比纸上交易更乐观。 纸上交易比现场交易更乐观。 因此,如果模拟没有产生好的结果,很可能纸上交易或(推而广之)实时交易也不会。

XCoin 使用限价(制造商)订单还是市场(接受者)订单?

XCoin 默认使用限价单,因为在大多数交易所,限价单的费用低于市价单。 例如,在 GDAX 上,限价订单交易不收取任何费用,而市价订单的交易费用为 0.25%(BTC)或 0.3%(ETH 和 LTC)。

MIT 授权

- diff --git a/zh/index.html b/zh/index.html index 4688181..90bce35 100644 --- a/zh/index.html +++ b/zh/index.html @@ -10,12 +10,12 @@ - +
Skip to content

XCoin

下一代交易机器人

基于Nodejs,简单而强大的数字资产交易机器人。

XCoin

不限交易对

支持同时交易多个交易对,只要服务器有足够算力,理论上你可以同时交易所有交易对。

不限交易所

支持 ccxt 支持的所有交易所,轻松添加自定义交易所。

全新策略框架

支持 technicalindicators 支持的所有交易策略,轻松通过JSON文件扩展新的策略。

支持多空交易

支持期货交易并可控制是多空双方还是仅交易多方,空方。

四种交易模式

支持多种交易方式,自动买,手动买,手动卖或完全手动模式。

监控池定制

支持监控已购项目,支持黑名单,支持动态添加监控项目。

多机器人同时运行

支持在单独线程上获取价格更新,支持同一机器同一交易所部署多个机器人。

支持模拟与回测交易

支持真实交易,虚拟交易及对交易进行回测。

移动与桌面设备支持

支持所有移动设备与桌面设备,实时控制机器人的全部状态与操作

MIT 授权

- diff --git a/zh/pm2.html b/zh/pm2.html index b907faa..5d6d6bb 100644 --- a/zh/pm2.html +++ b/zh/pm2.html @@ -10,7 +10,7 @@ - + @@ -47,8 +47,8 @@ - 任务名不能重复 -- config.base上的name最好使用新的名字以免restart文件重复 - diff --git a/zh/start.html b/zh/start.html index e25ece2..bb0c123 100644 --- a/zh/start.html +++ b/zh/start.html @@ -10,15 +10,15 @@ - +
Skip to content
在此页

快速开始

第一步 需求

  • Windows / Linux / macOS 10 (or Docker)
  • Node.js (version 12.0.0 or higher) and MongoDB.

第二步 安装

在终端中运行,

bash
git clone https://github.com/rainfu/xcoin.git

或者,直接下载,

bash
wget https://github.com/rainfu/xcoin/archive/master.tar.gz
 tar -xf master.tar.gz
 mv xcoin-master xcoin

创建您的安全配置文件 config/conf-secret-sample.js to config/conf-secret.js:

bash
cp conf--secret-sample.js conf.js
  • 添加数据库,第三方交易所API等必要数据,安全已见,请不要在第三方API中提供转账功能
  • 查看与编辑 conf-base.js以满足您的交易习惯.
  • 查看与编辑 conf-future.js 以满足您的期货交易习惯.
  • 如果您需要使用独立的价格更新线程,请修改conf-server.js
  • 如果您需要使用 PM2 来管理您的线程,请查看或编辑 binane.config.js

初始化项目:

bash
cd xcoin
-yarn

一些常见的命令

获得帮助:

bash
node ./xcoin --help

列出所有的交易策略:

bash
node ./xcoin strategies

获得某一交易所您的资产

bash
node ./xcoin exchange binance --balance

运行XCoin

下面命令将模拟交易币安交易所的BTC与ETH两个交易对.

bash
node ./xcoin trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper

您也可以直接使用yarn 命令,两者效果相同

bash
yarn trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper

使用 --paper 标识来决定是真实交易还是模拟交易.

使用 --trade_type 标识来确认交易机器人进行交易的方式 ,包括

  • auto 自动买卖

  • autoBuy 自动买

  • autoSell 自动卖

  • manual 手动

使用 --conf 标识来确认交易机器人使用的配置文件,该配置文件将覆盖 conf-base.js配置文件

下列命令将交易指定配置文件下的设置

bash
yarn trade binance --conf ./data/config/binance/30mf.json

更多命令行可带交易参数请查看 commands/trade.js 文件,所有交易参考均可直接在config文件中设定

bash
yarn trade --help

MIT 授权

- diff --git a/zh/strategy.html b/zh/strategy.html index 3288b29..d877c41 100644 --- a/zh/strategy.html +++ b/zh/strategy.html @@ -10,7 +10,7 @@ - + @@ -135,8 +135,8 @@ } } ] -}

系统提供的策略类型

目前系统提供了如下几种策略,其中CUSTOM策略是一种自由组合策略,其它策略均是与RSI进行组合的策略。他们位于 /extensions/strategies/list 目录内,technicalindicators 库提供了绝大部分当前可用的交易策略,您可以随时将新的策略添加至系统或用户策略。

创建您自己的策略

如果您希望在现有策略上进行组合,请在 /data/strategies内创建建一个新的json文件,将strategies内添加您希望使用的系统策略即可,您可以使用一种,两种或任意种策略,注意处理好策略之间的合作关系(connect type)即可。

如果您希望扩展现有的系统策略,请了解 technicalindicators 库,了解strategy.js 策略文件的运行逻辑,在 /extensions/strategies/list 中添加新的json文件并设置好参数即可,您可以随时通过运行trade.js来检测策略是否正确讲得并正确显示

-