mirror of
https://github.com/multipleof4/KalBot.git
synced 2026-03-16 21:41:02 +00:00
Fix: Prevent bot from placing 100¢ trades with zero profit potential
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user