INNER CODE UNIT · Python
INITIAL_SL_PCT
aaryansinha16/AI-trader · backend/app.py:225
INITIAL_SL_PCT = 0.15 # Initial SL at 15% below entry
TRAIL_ACTIVATE_PCT = 0.10 # Start trailing once profit > 10%
TRAIL_FACTOR = 0.50 # Trail SL at 50% of max profit
TGT_PCT = 0.50 # Target at 50% above entry
COMMISSION = 40.0
LIVE_CACHE_FILE = "/tmp/td_live_prices.json"
# Background processes
_tick_monitor_thread = None
_collector_process = None
_tick_monitor_rest_ts: dict = {} # symbol -> last REST fallback timestamp
predictor = Predictor()
strategy_predictor = StrategyPredictor()
regime_detector = RegimeDetector()
HTML_TEMPLATE = """
<!DOCTYPE html>