skyffire 1 жил өмнө
parent
commit
1cd2f85007

+ 2 - 2
pull_k_lines.js

@@ -7,7 +7,7 @@ const logger = require('./utils/logger')
 
 
 const BASE_REST = 'https://api.binance.com'
 const BASE_REST = 'https://api.binance.com'
 const QUOTE_ASSET = 'USDT'                                    // 拉取什么交易对的
 const QUOTE_ASSET = 'USDT'                                    // 拉取什么交易对的
-const NUMBER_OF_DAYS_TO_PULL = 1095                         // 一共拉取多少天的数据
+const NUMBER_OF_DAYS_TO_PULL = 10000                         // 一共拉取多少天的数据
 
 
 const socksProxy = 'socks://127.0.0.1:7890';
 const socksProxy = 'socks://127.0.0.1:7890';
 const agent = new SocksProxyAgent(socksProxy);
 const agent = new SocksProxyAgent(socksProxy);
@@ -55,7 +55,7 @@ async function main() {
   for (let i = 0; i < symbols.length; i++) {
   for (let i = 0; i < symbols.length; i++) {
     let symbol = symbols[i]
     let symbol = symbols[i]
     const kLines = await HttpQuery(
     const kLines = await HttpQuery(
-      `${BASE_REST}/api/v3/klines?symbol=${symbol.replace('_', '')}&interval=1d&limit=${NUMBER_OF_DAYS_TO_PULL}`)
+      `${BASE_REST}/api/v3/klines?symbol=${symbol.replace('_', '')}&interval=4h&limit=${NUMBER_OF_DAYS_TO_PULL}`)
 
 
     kLinesMap[symbol] = []
     kLinesMap[symbol] = []
     for (let kLine of kLines) {
     for (let kLine of kLines) {

+ 3 - 3
十面埋伏分析.js

@@ -219,7 +219,7 @@ async function main() {
 
 
   const FIRST_FEW_DAYS = 1               // 第几天的数据,0表示今天,1表示昨天,2表示前天,以此类推
   const FIRST_FEW_DAYS = 1               // 第几天的数据,0表示今天,1表示昨天,2表示前天,以此类推
   const BUY_LIMIT_RATE = 0               // 从什么比例入场
   const BUY_LIMIT_RATE = 0               // 从什么比例入场
-  const BAKE_TEST_DAYS = 800              // 一共回测多少天, 150天是熊市最没有交易量的时候
+  const BAKE_TEST_DAYS = 980              // 一共回测多少天, 150天是熊市最没有交易量的时候
 
 
 
 
   let btcKLines = kLinesMap['BTC_USDT']
   let btcKLines = kLinesMap['BTC_USDT']
@@ -259,8 +259,8 @@ async function main() {
     let synProfit = NumKit.getSubFloat(expFakeProfit + expRealProfit, 2)
     let synProfit = NumKit.getSubFloat(expFakeProfit + expRealProfit, 2)
     let avgProfit = NumKit.getSubFloat(synProfit / (realLength + fakeLength), 2)
     let avgProfit = NumKit.getSubFloat(synProfit / (realLength + fakeLength), 2)
     let isStopLoss = false
     let isStopLoss = false
-    if (avgProfit < -1.732 || btcKlineDownRate > 1.732) {
-      avgProfit = -1.732
+    if (avgProfit < -0.5 || btcKlineDownRate > 0.5) {
+      avgProfit = -0.5
       isStopLoss = true
       isStopLoss = true
     }
     }