瀏覽代碼

一些因子上面的更新

skyffire 1 年之前
父節點
當前提交
5f8b931c10
共有 2 個文件被更改,包括 8 次插入8 次删除
  1. 2 2
      utils/chart-kit.js
  2. 6 6
      十面埋伏分析.js

+ 2 - 2
utils/chart-kit.js

@@ -52,7 +52,7 @@ module.exports = class ChartKit {
           type: 'bar',
           stack: 'Total',
           label: {
-            show: true,
+            show: false,
             position: 'left'
           },
           emphasis: {
@@ -65,7 +65,7 @@ module.exports = class ChartKit {
           type: 'bar',
           stack: 'Total',
           label: {
-            show: true
+            show: false
           },
           emphasis: {
             focus: 'series'

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

@@ -11,7 +11,7 @@ async function readData() {
 }
 
 /* 概率学说 */
-// 统计过去N日累计涨幅,【在-1%~-20%容易有亏损,有一定关系】
+// 统计过去N日累计涨幅,【有一定关系】
 function statisticA(kLines, index) {
   let startK = kLines[index - 10]
   let endK = kLines[index - 1]
@@ -72,14 +72,14 @@ function statisticD(_kLines, _index) {
 
 // 指标过滤
 function filter(kLines, index) {
-  // 过去N日累计涨幅,85表示亏15%,115表示赚15%,100是分界线
+  // 过去N根K的累计涨幅
   let upRateN = statisticA(kLines, index)
-  if (upRateN >= 85 && upRateN <= 100) {
+  if (upRateN <= 75 || upRateN >= 95) {
     return false
   }
 
   // 一共N天涨幅超过M%
-  if (statisticB(kLines, index) !== 0) {
+  if (statisticB(kLines, index) > 1) {
     return false
   }
 
@@ -169,7 +169,7 @@ function dragonAnalysis(btcKLines, kLinesMap, dragonMap, dayCount) {
     let kLines = kLinesMap[symbol]
     let index = kLines.length - (dayCount + 1)
 
-    let x = statisticD(kLines, index)
+    let x = statisticB(kLines, index)
     let y = dragonMap[symbol].Profit
 
     // logger.info(
@@ -219,7 +219,7 @@ async function main() {
 
   const FIRST_FEW_DAYS = 1               // 第几天的数据,0表示今天,1表示昨天,2表示前天,以此类推
   const BUY_LIMIT_RATE = 0               // 从什么比例入场
-  const BAKE_TEST_DAYS = 60              // 一共回测多少天, 150天是熊市最没有交易量的时候
+  const BAKE_TEST_DAYS = 988              // 一共回测多少天
 
 
   let btcKLines = kLinesMap['BTC_USDT']