bifitnex-trading/config.py
kroutony e2ec3cd920 Raise take-profit to 15% and tighten SELL conditions for longer holds
- TAKE_PROFIT_PCT 5% → 15% (risk/reward 5:1 vs 3% stop-loss)
- SELL signal now requires ≥2 confirmations (was 1)
- Add 1h trend filter: hold if 1h still bullish even if 5m shows sell
- Sync cost_tracking.json and stop_orders.json after balance refresh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 03:38:42 +00:00

70 lines
2.1 KiB
Python

import os
from dotenv import load_dotenv
load_dotenv()
# Bitfinex API
BFX_API_KEY = os.getenv("BFX_API_KEY", "")
BFX_API_SECRET = os.getenv("BFX_API_SECRET", "")
BFX_BASE_URL = "https://api-pub.bitfinex.com"
BFX_AUTH_URL = "https://api.bitfinex.com"
# Slack
SLACK_WEBHOOK_URL = os.getenv("SLACK_WEBHOOK_URL", "")
# Top USDT trading pairs on Bitfinex (verified active)
# Note: some use "tXXXUST" format, others use "tXXX:UST" (5+ char base)
TOP_15_SYMBOLS = [
"tBTCUST", "tETHUST", "tSOLUST", "tXRPUST", "tADAUST",
"tDOGE:UST", "tAVAX:UST", "tDOTUST", "tLINK:UST", "tLTCUST",
"tSHIB:UST", "tATOUST", "tUNIUST", "tSUIUST", "tXLMUST",
]
# Symbol display names for readability
SYMBOL_NAMES = {
"tBTCUST": "BTC/USDT", "tETHUST": "ETH/USDT", "tSOLUST": "SOL/USDT",
"tXRPUST": "XRP/USDT", "tADAUST": "ADA/USDT", "tDOGE:UST": "DOGE/USDT",
"tAVAX:UST": "AVAX/USDT", "tDOTUST": "DOT/USDT", "tLINK:UST": "LINK/USDT",
"tLTCUST": "LTC/USDT", "tSHIB:UST": "SHIB/USDT", "tATOUST": "ATOM/USDT",
"tUNIUST": "UNI/USDT", "tSUIUST": "SUI/USDT", "tXLMUST": "XLM/USDT",
}
# Candle settings
CANDLE_TIMEFRAME = "5m"
CANDLE_LIMIT = 100
HTF_TIMEFRAME = "1h"
HTF_CANDLE_LIMIT = 50
# Trading parameters
MIN_ORDER_USDT = 5
MIN_ORDER_AMOUNT = {
"tBTCUST": 0.00004, "tETHUST": 0.0008, "tDOTUST": 0.2,
"tSUIUST": 2.0, "tSOLUST": 0.02, "tLTCUST": 0.04,
"tADAUST": 4.0, "tAVAX:UST": 0.08, "tUNIUST": 0.2,
"tLINK:UST": 0.2, "tXRPUST": 4.0, "tSHIB:UST": 141010.0,
"tDOGE:UST": 22.0, "tATOUST": 0.02, "tXLMUST": 4.0,
}
STOP_LOSS_PCT = 0.03
TAKE_PROFIT_PCT = 0.15
MAX_POSITION_PCT = 0.30 # Max 30% of portfolio per coin
MAX_TOTAL_EXPOSURE_PCT = 1.00 # No cap — use full balance
# Mode
PAPER_TRADING = os.getenv("PAPER_TRADING", "true").lower() == "true"
# Cache
CACHE_DIR = "cache/"
CANDLES_CACHE_DIR = os.path.join(CACHE_DIR, "candles/")
INDICATORS_CACHE_DIR = os.path.join(CACHE_DIR, "indicators/")
# Positions file
POSITIONS_FILE = "positions.json"
# Cost basis sync
COST_TRACKING_FILE = "cost_tracking.json"
INIT_COST_BASIS_START_MS = 1773244800000 # 2026-03-11 00:00:00 +08:00
# Schedule
RUN_INTERVAL_MINUTES = 5
STATUS_REPORT_INTERVAL_MINUTES = 60