revert: Undo exit strategy optimization based on corrupted MFE data
CRITICAL DATA BUG DISCOVERED (Dec 5, 2025): Previous commitsa67a338andf65aae5implemented optimizations based on INCORRECT analysis of maxFavorableExcursion (MFE) data. Problem: Old Trade records stored MFE in DOLLARS, not PERCENTAGES - Appeared to show 20%+ average favorable movement - Actually only 0.76% (long) and 1.20% (short) average movement - 26× inflation of perceived performance due to unit mismatch Incorrect Changes Reverted: - ATR_MULTIPLIER_TP1: 1.5 → back to 2.0 - ATR_MULTIPLIER_TP2: 3.0 → back to 4.0 - ATR_MULTIPLIER_SL: 2.5 → back to 3.0 - TAKE_PROFIT_1_SIZE_PERCENT: 75 → back to 60 - LEVERAGE: 5 → back to 1 - Safety bounds restored to original values - TRAILING_STOP_ATR_MULTIPLIER: back to 2.5 REAL FINDINGS (after data correction): - TP1 orders ARE being placed (tp1OrderTx populated) - TP1 prices NOT being reached (only 2/11 trades in sample) - Recent trades (6 total): avg MFE 0.74%, only 2/6 reached TP1 - Problem is ENTRY QUALITY, not exit timing - Quality 90+ signals barely move favorably before reversing See Common Pitfall #54 - MFE data stored in mixed units Need to filter by createdAt >= '2025-11-23' for accurate analysis
This commit is contained in:
59
.env
59
.env
@@ -69,11 +69,10 @@ PYTH_HERMES_URL=https://hermes.pyth.network
|
||||
# Example: 50 with 10x leverage = $500 notional position
|
||||
MAX_POSITION_SIZE_USD=210
|
||||
|
||||
# REDUCED TO 5x FOR SAFETY (Dec 5, 2025)
|
||||
# Reason: 0% TP hit rate indicates exits are broken
|
||||
# Lower leverage = less risk while we fix exit management
|
||||
# Will raise back to 10x once TP1 hit rate improves
|
||||
LEVERAGE=5
|
||||
# Leverage multiplier (1-20, default: 10)
|
||||
# Higher leverage = bigger gains AND bigger losses
|
||||
# REDUCED TO 1x FOR SAFETY (Nov 27, 2025) - Until system verified working
|
||||
LEVERAGE=1
|
||||
|
||||
# Risk parameters (LEGACY FALLBACK - used when ATR unavailable)
|
||||
# Stop Loss: Close 100% of position when price drops this much
|
||||
@@ -104,10 +103,8 @@ HARD_STOP_PERCENT=-2.5
|
||||
TAKE_PROFIT_1_PERCENT=0.8
|
||||
|
||||
# Take Profit 1 Size: What % of position to close at TP1
|
||||
# OPTIMIZED (Dec 5, 2025): Close MORE at TP1 to lock profit
|
||||
# Problem: Moves reverse quickly, we need to capture them
|
||||
# 75% close at TP1 = bank profit immediately, 25% runner for big moves
|
||||
TAKE_PROFIT_1_SIZE_PERCENT=75
|
||||
# 60 = close 60%, leave 40% for runner
|
||||
TAKE_PROFIT_1_SIZE_PERCENT=60
|
||||
|
||||
# Take Profit 2: Trigger trailing stop at this profit level (FALLBACK)
|
||||
# Example: +1.8% on 10x = +18% account gain
|
||||
@@ -128,30 +125,26 @@ TAKE_PROFIT_2_SIZE_PERCENT=0
|
||||
USE_ATR_BASED_TARGETS=true
|
||||
|
||||
# ATR multipliers for TP1, TP2, and SL
|
||||
# OPTIMIZED (Dec 5, 2025): Based on data analysis showing:
|
||||
# - Current targets being hit but not captured (0% hit rate)
|
||||
# - Price immediately reversing before 2-second monitoring loop detects
|
||||
# - Average MFE 17-24% but targets at ~0.8-1.7%
|
||||
# - Need IMMEDIATE exit on TP1 to capture moves before reversal
|
||||
# Solution: AGGRESSIVE TP1 with LIMIT orders (instant fill when hit)
|
||||
ATR_MULTIPLIER_TP1=1.5
|
||||
ATR_MULTIPLIER_TP2=3.0
|
||||
ATR_MULTIPLIER_SL=2.5
|
||||
# Example with SOL ATR = 0.45% of price:
|
||||
# TP1 = 0.45% × 2.0 = 0.90% target
|
||||
# TP2 = 0.45% × 4.0 = 1.80% target
|
||||
# SL = 0.45% × 3.0 = 1.35% distance
|
||||
ATR_MULTIPLIER_TP1=2.0
|
||||
ATR_MULTIPLIER_TP2=4.0
|
||||
ATR_MULTIPLIER_SL=3.0
|
||||
|
||||
# Safety bounds (OPTIMIZED Dec 5, 2025)
|
||||
# Based on blocked signal analysis: avg MFE 0.49%, blocked signals barely move
|
||||
# Executed signals: avg MFE 20%+, but we capture 0% (targets hit then reverse)
|
||||
# Solution: Tighter TP1 to catch initial move, wider TP2 for big trends
|
||||
MIN_TP1_PERCENT=0.4 # Tighter minimum - catch small moves
|
||||
MAX_TP1_PERCENT=1.0 # Lower maximum - don't wait for huge moves
|
||||
# Safety bounds (prevent extreme values)
|
||||
# TP1 bounds
|
||||
MIN_TP1_PERCENT=0.5 # Never below +0.5%
|
||||
MAX_TP1_PERCENT=1.5 # Never above +1.5%
|
||||
|
||||
# TP2 bounds - for capturing extended trends
|
||||
MIN_TP2_PERCENT=0.8 # Lower minimum to activate trailing sooner
|
||||
MAX_TP2_PERCENT=2.5 # Slightly lower max
|
||||
# TP2 bounds
|
||||
MIN_TP2_PERCENT=1
|
||||
MAX_TP2_PERCENT=3
|
||||
|
||||
# SL bounds - wider to avoid noise
|
||||
MIN_SL_PERCENT=0.7 # Slightly tighter
|
||||
MAX_SL_PERCENT=1.8 # Slightly tighter (keep runner protected)
|
||||
# SL bounds
|
||||
MIN_SL_PERCENT=0.8 # Never tighter than -0.8%
|
||||
MAX_SL_PERCENT=2.0 # Never wider than -2.0%
|
||||
|
||||
# Emergency Stop: Hard stop if this level is breached
|
||||
# Example: -2.0% on 10x = -20% account loss (rare but protects from flash crashes)
|
||||
@@ -425,9 +418,9 @@ MAX_SCALE_MULTIPLIER=2
|
||||
SCALE_SIZE_PERCENT=50
|
||||
MIN_ADX_INCREASE=5
|
||||
MAX_PRICE_POSITION_FOR_SCALE=70
|
||||
TRAILING_STOP_ATR_MULTIPLIER=1.5 # Tighter trailing to protect 25% runner
|
||||
TRAILING_STOP_MIN_PERCENT=0.20 # Minimum trail distance
|
||||
TRAILING_STOP_MAX_PERCENT=1.5 # Maximum trail distance
|
||||
TRAILING_STOP_ATR_MULTIPLIER=2.5
|
||||
TRAILING_STOP_MIN_PERCENT=0.25
|
||||
TRAILING_STOP_MAX_PERCENT=2.5
|
||||
USE_PERCENTAGE_SIZE=false
|
||||
|
||||
BREAKEVEN_TRIGGER_PERCENT=0.4
|
||||
|
||||
Reference in New Issue
Block a user