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';
|
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 {
|
export class ThresholdStrategy extends BaseStrategy {
|
||||||
constructor(config = {}) {
|
constructor(config = {}) {
|
||||||
super('threshold', {
|
super('threshold', {
|
||||||
@@ -33,7 +25,7 @@ export class ThresholdStrategy extends BaseStrategy {
|
|||||||
|
|
||||||
let signal = null;
|
let signal = null;
|
||||||
|
|
||||||
if (yesPct >= trigger) {
|
if (yesPct >= trigger && noPct < 99) {
|
||||||
signal = {
|
signal = {
|
||||||
strategy: this.name,
|
strategy: this.name,
|
||||||
side: 'no',
|
side: 'no',
|
||||||
@@ -42,7 +34,7 @@ export class ThresholdStrategy extends BaseStrategy {
|
|||||||
reason: `Yes at ${yesPct}% (≥${trigger}%), contrarian No at ${noPct}¢`,
|
reason: `Yes at ${yesPct}% (≥${trigger}%), contrarian No at ${noPct}¢`,
|
||||||
ticker: state.ticker
|
ticker: state.ticker
|
||||||
};
|
};
|
||||||
} else if (noPct >= trigger) {
|
} else if (noPct >= trigger && yesPct < 99) {
|
||||||
signal = {
|
signal = {
|
||||||
strategy: this.name,
|
strategy: this.name,
|
||||||
side: 'yes',
|
side: 'yes',
|
||||||
|
|||||||
Reference in New Issue
Block a user