Unlimited trading pairs
Support trading multiple trading pairs at the same time, you can trade all pairs at the same time.
diff --git a/404.html b/404.html index a0bbf07..ac90a29 100644 --- a/404.html +++ b/404.html @@ -12,7 +12,7 @@
404
But if you don't change your direction, and if you keep looking, you may end up where you are heading.
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('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('XCoin provides a unified API for client programs, and provides the following information through the API
XCoin provides a unified API for client programs, and provides the following information through the API
XCoin initializes bots through configuration files, including the following types of configuration files
conf-base.js basic configuration
conf-secret.js security configuration
conf-server.js server configuration
conf-future.js futures basic configuration
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
The loading process of the configuration file is as follows
--conf
in the command line parameters and overwrite the initial configuration--conf
does not specify a configuration file but /data/config/last_config.json exists, then load last-config.json
yarn trade binance --paper --trade_type autoBuy
, then paper=true and trade_type='autoBuy' will become the preferred configurationThe 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
{
+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
- Load the initial configuration file, /config/conf-base.js to get all the initial configuration
- Load the specified configuration file: the configuration file specified by
--conf
in the command line parameters and overwrite the initial configuration - 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
- 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
javascripttry {
+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
javascripttry {
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
- Will I make money with XCoin?
- Why do simulations, paper trading, and live trading all yield different results?
- Why should I use simulations or paper trading if they do not reflect live trading?
- Does XCoin use Limit (maker) orders or Market (taker) orders?
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
- Will I make money with XCoin?
- Why do simulations, paper trading, and live trading all yield different results?
- Why should I use simulations or paper trading if they do not reflect live trading?
- Does XCoin use Limit (maker) orders or Market (taker) orders?
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
bashyarn 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
- Create a binanceusdm.config.js file under /config/
javascriptmodule.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
bashyarn 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
- Create a binanceusdm.config.js file under /config/
javascriptmodule.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
Setp 2 Install
run in terminal,
bashgit clone https://github.com/rainfu/xcoin.git
Or, to download directly,
bashwget 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
Setp 2 Install
run in terminal,
bashgit clone https://github.com/rainfu/xcoin.git
Or, to download directly,
bashwget 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
:
bashcp 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:
bashcd xcoin
yarn
Some common commands
Get help:
bashnode ./xcoin --help
List all trading strategies:
bashnode ./xcoin strategies
Get your assets on an exchange
bashnode ./xcoin exchange binance --balance
Run XCoin
The following command will simulate two trading pairs of BTC and ETH on Binance Exchange.
bashnode ./xcoin trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper
You can also use the yarn command directly, both have the same effect
bashyarn 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
bashyarn 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
bashyarn 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管理机器人
配置文件加载流程
配置文件的加载过程如下
加载 初始配置文件,/config/conf-base.js获得所有初始配置
加载指定配置文件:命令行参数中--conf
指定的配置文件并覆盖初始配置
加载上次使用配置文件 :如果--conf
未指定配置文件但 /data/config/last_config.json存在,则加载last-config.json
加载命令行参数指定的配置,如用户作用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管理机器人
配置文件加载流程
配置文件的加载过程如下
加载 初始配置文件,/config/conf-base.js获得所有初始配置
加载指定配置文件:命令行参数中--conf
指定的配置文件并覆盖初始配置
加载上次使用配置文件 :如果--conf
未指定配置文件但 /data/config/last_config.json存在,则加载last-config.json
加载命令行参数指定的配置,如用户作用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通过如下方法初始化交易所
javascripttry {
+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通过如下方法初始化交易所
javascripttry {
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
bashyarn global add pm2
如何使用
假设您需要通过pm2管理一个使用币安期货进行交易的机器人组,组内包含两个机器人,一个数据更新线程。您需要
- 在/config/下建立一个binanceusdm.config.js的文件
javascriptmodule.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
bashyarn global add pm2
如何使用
假设您需要通过pm2管理一个使用币安期货进行交易的机器人组,组内包含两个机器人,一个数据更新线程。您需要
- 在/config/下建立一个binanceusdm.config.js的文件
javascriptmodule.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(`快速开始
第一步 需求
第二步 安装
在终端中运行,
bashgit clone https://github.com/rainfu/xcoin.git
或者,直接下载,
bashwget 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(`快速开始
第一步 需求
第二步 安装
在终端中运行,
bashgit clone https://github.com/rainfu/xcoin.git
或者,直接下载,
bashwget 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
:
bashcp conf--secret-sample.js conf.js
- 添加数据库,第三方交易所API等必要数据,安全已见,请不要在第三方API中提供转账功能
- 查看与编辑
conf-base.js
以满足您的交易习惯. - 查看与编辑
conf-future.js
以满足您的期货交易习惯. - 如果您需要使用独立的价格更新线程,请修改conf-server.js
- 如果您需要使用 PM2 来管理您的线程,请查看或编辑
binane.config.js
初始化项目:
bashcd xcoin
yarn
一些常见的命令
获得帮助:
bashnode ./xcoin --help
列出所有的交易策略:
bashnode ./xcoin strategies
获得某一交易所您的资产
bashnode ./xcoin exchange binance --balance
运行XCoin
下面命令将模拟交易币安交易所的BTC与ETH两个交易对.
bashnode ./xcoin trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper
您也可以直接使用yarn 命令,两者效果相同
bashyarn trade binance --watch-symbols binance.BTC-USDT,ETH-USDt --paper
使用 --paper
标识来决定是真实交易还是模拟交易.
使用 --trade_type
标识来确认交易机器人进行交易的方式 ,包括
auto 自动买卖
autoBuy 自动买
autoSell 自动卖
manual 手动
使用 --conf
标识来确认交易机器人使用的配置文件,该配置文件将覆盖 conf-base.js
配置文件
下列命令将交易指定配置文件下的设置
bashyarn trade binance --conf ./data/config/binance/30mf.json
更多命令行可带交易参数请查看 commands/trade.js 文件,所有交易参考均可直接在config文件中设定
bashyarn 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
}
-}
-
diff --git a/developer.html b/developer.html
index d5b1645..8efa19d 100644
--- a/developer.html
+++ b/developer.html
@@ -10,12 +10,12 @@
-
+
-
-
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
Next Gerneration Trading Bot
A Simple and Powerful Trading Robot Based on Nodejs.
Support trading multiple trading pairs at the same time, you can trade all pairs at the same time.
Support all exchanges supported by ccxt, easily add custom exchanges.
Support all trading strategies supported by technicalindicators, and easily extend new strategies through JSON files.
Supports futures trading and can control whether it is long or short or both trading.
Support multiple trading methods, automatic buying, manual buying, manual selling or full manual.
Supports Watching of purchased items, blacklist, and dynamic addition of watch items.
Supports obtaining price updates on a separate thread, and supports deploying multiple bots on the same machine.
Supports real trade, virtual trade and backtesting.
Support all mobile devices and desktop devices, real-time control of all states and operations of the robot
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
The task name cannot be repeated
It is better to use a new name for the name on config.base to avoid duplication of restart files
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.
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 @@ - + - - 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 @@ - + - - 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 @@ - + - - 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文件
如果交易所基于ccxt,您只需对细节部分进行调整即可
如果交易所基于其它API,您需要实现CCXT交易所提供的必要函数的实现
支持同时交易多个交易对,只要服务器有足够算力,理论上你可以同时交易所有交易对。
支持 ccxt 支持的所有交易所,轻松添加自定义交易所。
支持 technicalindicators 支持的所有交易策略,轻松通过JSON文件扩展新的策略。
支持期货交易并可控制是多空双方还是仅交易多方,空方。
支持多种交易方式,自动买,手动买,手动卖或完全手动模式。
支持监控已购项目,支持黑名单,支持动态添加监控项目。
支持在单独线程上获取价格更新,支持同一机器同一交易所部署多个机器人。
支持真实交易,虚拟交易及对交易进行回测。
支持所有移动设备与桌面设备,实时控制机器人的全部状态与操作
目前系统提供了如下几种策略,其中CUSTOM策略是一种自由组合策略,其它策略均是与RSI进行组合的策略。他们位于 /extensions/strategies/list 目录内,technicalindicators 库提供了绝大部分当前可用的交易策略,您可以随时将新的策略添加至系统或用户策略。
PSAR
BOLLINGERBANDS
MACD
CANDLESTICK
RSI
CUSTOM
如果您希望在现有策略上进行组合,请在 /data/strategies内创建建一个新的json文件,将strategies内添加您希望使用的系统策略即可,您可以使用一种,两种或任意种策略,注意处理好策略之间的合作关系(connect type)即可。
如果您希望扩展现有的系统策略,请了解 technicalindicators 库,了解strategy.js 策略文件的运行逻辑,在 /extensions/strategies/list 中添加新的json文件并设置好参数即可,您可以随时通过运行trade.js来检测策略是否正确讲得并正确显示
-