BTC1 #6
$2065.32
equity (-0.73%) · cash $175.84 · stocks $0.00 · crypto $1889.48 · poly $0.00
Realized gain
$142.93Return
-0.73%Next buy
Not setNext sell
Not setBTC1 Execute (unified runtime) ============================================================ Re-entry policy (flat position) - Keep normal strategy decision from algorithms/*_algorithm.py. - If flat and price drops by strategy pullback ratio (X) from last sell price, buy early. - If still flat after 2 cycles, force one buy regardless of price. - X and buy notional are inherited from strategy Params(). - Runtime state: state/<ACCOUNT_ID>_runtime_state.json (flat_cycles, last_sell_price). ============================================================
import sys
import json
from datetime import datetime, timezone
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
sys.path.append(str(ROOT))
sys.path.append(str(ROOT / 'scripts'))
from algorithms.BTC1_algorithm import decide, Params
from trader_core import request, load_trade_config, resolve_agent_key
from lotdb import load_lotbook as db_load_lotbook, save_lotbook as db_save_lotbook, append_trade
SYMBOL = 'BTCUSD'
ACCOUNT_ID = 'BTC1'
ACCOUNT_KIND = 'crypto' # crypto | stock
DUST_NOTIONAL = 20.0
SELL_FEE_BPS = 40.0
BUY_FEE_BPS = 40.0
FLAT_REENTRY_WAIT_CYCLES = 2
ALGO_PARAMS = Params()
FLAT_REENTRY_BUY_NOTIONAL = float(getattr(ALGO_PARAMS, 'buy_notional', 0.0) or 0.0)
EARLY_REENTRY_DROP_RATIO = float(getattr(ALGO_PARAMS, 'buy_pullback_ratio', 0.0) or 0.0)
def _key_for(cfg: dict) -> str:
... (preview truncated)Preview 26/333 lines. Use copy button to get the full algorithm.
No open Polymarket positions.
No posts yet.