mirror of
https://github.com/multipleof4/KalBot.git
synced 2026-03-17 05:51:02 +00:00
Delete lib/strategies/dont-doubt-bull.js
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
import { BaseStrategy } from './base.js';
|
||||
|
||||
export class DontDoubtBullStrategy extends BaseStrategy {
|
||||
constructor(config = {}) {
|
||||
super('dont-doubt-bull', {
|
||||
minYesPct: config.minYesPct || 30,
|
||||
maxYesPct: config.maxYesPct || 40,
|
||||
betSize: config.betSize || 2,
|
||||
slippage: config.slippage || 3,
|
||||
cooldownMs: config.cooldownMs || 20000,
|
||||
...config
|
||||
});
|
||||
|
||||
this._lastTrade = {
|
||||
paper: { time: 0, ticker: null },
|
||||
live: { time: 0, ticker: null }
|
||||
};
|
||||
}
|
||||
|
||||
evaluate(state, caller = 'paper') {
|
||||
if (!state || !this.enabled || !state.closeTime) return null;
|
||||
|
||||
const track = this._lastTrade[caller] || this._lastTrade.paper;
|
||||
const now = Date.now();
|
||||
if (now - track.time < this.config.cooldownMs) return null;
|
||||
if (state.ticker === track.ticker) return null;
|
||||
|
||||
const timeLeftMs = new Date(state.closeTime).getTime() - now;
|
||||
const minsLeft = timeLeftMs / 60000;
|
||||
if (minsLeft > 14 || minsLeft < 10) return null;
|
||||
|
||||
const { yesPct } = state;
|
||||
|
||||
if (yesPct >= this.config.minYesPct && yesPct <= this.config.maxYesPct) {
|
||||
const maxPrice = Math.min(yesPct + this.config.slippage, 95);
|
||||
|
||||
const signal = {
|
||||
strategy: this.name,
|
||||
side: 'yes',
|
||||
price: yesPct,
|
||||
maxPrice,
|
||||
size: this.config.betSize,
|
||||
reason: `Early Bullish Dip: ${minsLeft.toFixed(1)}m left, Yes @ ${yesPct}¢`,
|
||||
ticker: state.ticker
|
||||
};
|
||||
|
||||
track.time = now;
|
||||
track.ticker = state.ticker;
|
||||
return signal;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user