From 9f0ff5811801ab98c61bdc60446569cf7fd7d6fd Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sun, 15 Mar 2026 18:49:43 -0700 Subject: [PATCH] =?UTF-8?q?Fix:=20Prevent=20bot=20from=20placing=20100?= =?UTF-8?q?=C2=A2=20trades=20with=20zero=20profit=20potential?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/strategies/threshold.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/strategies/threshold.js b/lib/strategies/threshold.js index ecea61f..19203b3 100644 --- a/lib/strategies/threshold.js +++ b/lib/strategies/threshold.js @@ -1,13 +1,5 @@ import { BaseStrategy } from './base.js'; -/** - * Threshold (Contrarian) Strategy - * - * Logic: - * - If one side goes above a high threshold (e.g. 65%), bet the other. - * - Fixed bet size — no progression. - * - Simple mean-reversion assumption for short-term BTC markets. - */ export class ThresholdStrategy extends BaseStrategy { constructor(config = {}) { super('threshold', { @@ -33,7 +25,7 @@ export class ThresholdStrategy extends BaseStrategy { let signal = null; - if (yesPct >= trigger) { + if (yesPct >= trigger && noPct < 99) { signal = { strategy: this.name, side: 'no', @@ -42,7 +34,7 @@ export class ThresholdStrategy extends BaseStrategy { reason: `Yes at ${yesPct}% (≥${trigger}%), contrarian No at ${noPct}¢`, ticker: state.ticker }; - } else if (noPct >= trigger) { + } else if (noPct >= trigger && yesPct < 99) { signal = { strategy: this.name, side: 'yes',