|
|
@@ -214,12 +214,15 @@ async function main() {
|
|
|
|
|
|
const FIRST_FEW_DAYS = 1 // 第几天的数据,0表示今天,1表示昨天,2表示前天,以此类推
|
|
|
const BUY_LIMIT_RATE = 0 // 从什么比例入场
|
|
|
- const BAKE_TEST_DAYS = 800 // 一共回测多少天, 150天是熊市最没有交易量的时候
|
|
|
+ const BAKE_TEST_DAYS = 30 // 一共回测多少天, 150天是熊市最没有交易量的时候
|
|
|
|
|
|
|
|
|
let btcKLines = kLinesMap['BTC_USDT']
|
|
|
let totalProfit = 0
|
|
|
for (let day_count = FIRST_FEW_DAYS; day_count < FIRST_FEW_DAYS + BAKE_TEST_DAYS; day_count++) {
|
|
|
+ let btcKline = btcKLines[btcKLines.length - (day_count + 1)]
|
|
|
+ let btcKlineDownRate = 100 * (btcKline.Close > btcKline.Open ? ((btcKline.Open - btcKline.Low) / btcKline.Open) : 0) // 计算如果是阳线时的下影线
|
|
|
+
|
|
|
// 赚钱榜
|
|
|
// logger.info("----------------赚钱榜数据分析----------------")
|
|
|
let realDragonProfit = 0
|
|
|
@@ -251,7 +254,7 @@ async function main() {
|
|
|
let synProfit = NumKit.getSubFloat(expFakeProfit + expRealProfit, 2)
|
|
|
let avgProfit = NumKit.getSubFloat(synProfit / (realLength + fakeLength), 2)
|
|
|
let isStopLoss = false
|
|
|
- if (avgProfit < -0.7) {
|
|
|
+ if (avgProfit < -0.7 || btcKlineDownRate > 1) {
|
|
|
avgProfit = -1.0
|
|
|
isStopLoss = true
|
|
|
}
|