โš–๏ธ Strictly AS-IS Archival Documentation: Provided free of charge under the MIT License without warranty, financial/gambling advice, or technical support of any kind.

TITAN HFT ENGINE โ€” Detailed User Manual

Disclaimer: Educational and research material only โ€” not financial or investment advice. Trading involves substantial risk of loss; past or simulated results do not indicate future results. Titan HFT is provided AS-IS, with no liability and no support. No API keys are included.

Version: V7 Reloaded V5.9

Tab: HFT Engine (tab-4)

Date: March 28, 2026 (Session 19). Updated: April 3, 2026 (Session 69 โ€” Wave 2B SmartTrend Correctness)

Language: Romanian

Level: Beginner โ†’ Advanced


content

  1. Introduction
  2. Emergency Kill Dashboard
  3. Entry Parameters
  4. Exit Parameters
  5. Position Sizing
  6. Discord Alerts
  7. Telegram Alerts
  8. Safety Limits
  9. Correlation Matrix
  10. Portfolio Performance
  11. ATR Dynamic Stops
  12. LLM Sentiment
  13. Options Hedging
  14. Web Dashboard
  15. Autopilot Core
  16. Exit Scaling
  17. Oracle Exit
  18. Circuit Breaker
  19. Strategy Scoring
  20. Engine Stops
  21. Oracle Fusion
  22. Indicator Periods
  23. Adaptive Exit Multipliers
  24. Multi-Asset Control
  25. Effective Exit Values โ€‹โ€‹(Live Impact Preview)
  26. Heatmap mode
  27. Parameter Profiles
  28. Risk Calculator Live
  29. Parameter Health
  30. Auto-Suggest
  31. Per-Symbol Overrides
  32. Preset Bar โ€” Global Buttons and Controls
  33. Settings Diff Panel
  34. DRY RUN vs LIVE
  35. Persistence of Settings
  36. Recommendations and Tips
  37. Glossary of Terms
  38. Keyboard Shortcuts and Command Palette
  39. TA Entry Gates โ€” Pre-Entry Filters with Soft/Hard Mode
  40. IndicatorCache โ€” Hybrid Streaming + Oracle Cache
  41. Audio/Visual Alerts โ€” Titan Audio System
  42. Concurrent Autopilot Architecture (S5+S6)
  43. Portfolio Risk Gates โ€” VaR + HHI Concentration (S9)
  44. Feature Store โ€” Entry Context Snapshot (S13)
  45. Microstructure Score Modifier โ€” Stream VPIN + Spread Regime + Dual VPIN Divergence (S10-lite)
  46. Safety Gates โ€” VaR Fail-Closed, Asset Check, Intraday Blackout (S04.1)
  47. State Health Dots โ€” Sub-State Decomposition Monitor (S04.5)
  48. Score Modifiers + Classical Bonuses + Entry Threshold Matrix (N4)
  49. Oracle Weight Adaptation (S15)
  50. Exit Inflight Guard (S39-S40)

1. INTRODUCTION

What is the HFT Engine tab?

The HFT Engine tab (the 5th tab in the TITAN application, internally identified as tab-4) is the command center of the trading bot. Here you configure absolutely all the parameters that control the way the bot:

How is it accessed?

Click on the HFT Engine tab in the top navigation bar of the application. It is the 5th tab (after Chart, Scanner, News, Journal).

Basic principle

Each parameter in this tab:

  1. Adjusts with a slider (horizontal bar that you drag left/right)
  2. Displays the current value next to the slider
  3. It is saved on disk by clicking on SAVE CONFIG
  4. It is strictly respected by the bot during trading
  5. Survives the restart of the application

Conventions in this manual


2. EMERGENCY KILL DASHBOARD

What is it?

A red, sticky panel (remains visible at the top) that provides instant access to emergency actions and critical account status information.

Elements

ElementWhat it showsWhen it is important
KILL ALLRed emergency buttonPress ONLY in case of extreme emergency
BREAKERCircuit status BreakerConstantly monitor
EQUITYTotal account valuePermanent reference
DAILY P&LProfit/loss todayTrack daily performance
POSITIONSNo. open positionsCheck current exposure

KILL ALL button

What it does: After confirmation (cyberConfirm), liquidates all open positions and cancels all active orders. It is the equivalent of a "stop everything NOW".

When to use it:

Attention: The action is IRREVERSIBLE after confirmation. Once confirmed, all positions are closed at the current market price (market orders). There is no undo.

Circuit Breaker States

StatusColorWhat it means
NORMALGreenEverything is OK, the bot trades normally
CAUTIONYellowModerate losses today, bot becomes more conservative
HALTOrangeSignificant losses, bot stops new entries
PANICRed (flash)Serious losses, bot closes automatically

Example: You have a $10,000 account. If you lose $300 today (3%), the breaker switches to CAUTION. If you lose $500 (5%), go into HALT. If you lose $800 (8%), PANIC and close everything.


3. ENTRY PARAMETERS

These parameters control WHEN the bot opens a new position (enters a trade).

3.1 Signal Strength Min

PropertyValue
Default40
Range10 โ€” 95
What it doesMinimum strength of input signal

Explanation for beginners: The bot analyzes the market and generates a "score" of signal (from 0 to 100). This slider sets the minimum threshold: signals weaker than this value are ignored.

Example:

Recommendations:

3.2 OFI Threshold

OwnershipValue
Default5.0
Range0 โ€” 100 (displayed /10)
What it doesMinimum Threshold for Order Flow Imbalance

Explanation for beginners: OFI (Order Flow Imbalance) measures the difference between buy and sell orders in the orderbook. A large positive OFI means that there are many more buyers than sellers.

Example:

3.3 Max Spread (bps)

PropertyValue
Default50 bps
Range1 โ€” 500
What it doesMaximum spread accepted for input

Explanation for beginners: The spread is the difference between the purchase price (ask) and the sale price (bid). A large spread means that you lose money from the start when you enter. 1 bps = 0.01%.

Example: If BTC is trading at $50,000:

Recommendations:

3.4 Entry Cooldown (s)

PropertyValue
Default30 seconds
Range5 โ€” 3600 (1 hour)
What it doesMinimum time between two consecutive entries

Explanation for beginners: After the bot makes an entry, it must wait at least this number of seconds before doing another. Prevents "over-trading" (too many transactions in a short time).

Example:


4. EXIT PARAMETERS

These parameters control WHEN the bot closes an existing position.

4.1 Trailing Stop %

PropertyValue
Default1.5%
Range0.1% โ€” 20.0%
What it doesThe distance at which the trailing stop follows the price

Explanation for beginners: The trailing stop moves UP with the price but does NOT move down. When the price drops by X% compared to the maximum reached, the position is closed automatically.

Example with BTC at $50,000 and Trailing Stop = 1.5%:

  1. Buy at $50,000
  2. BTC rises to $51,000 โ†’ Trailing stop moves to $51,000 - 1.5% = $50,235
  3. BTC rises to $52,000 โ†’ Trailing stop moves to $52,000 - 1.5% = $51,220
  4. BTC drops to $51,220 โ†’ ACTIVATES, the position is closed with a profit of ~$1,220

Recommendations:

4.2 Take Profit %

PropertyValue
Default2.5%
Range0.1% โ€” 50.0%
What it doesThe profit percentage at which the position is automatically closed

Explanation for beginners: When the profit on a position reaches this percentage, the bot close the position and collect the profit. It's a "profit target".

Example with AAPL at $200 and Take Profit = 2.5%:

Attention: Trailing stop and take profit work TOGETHER. The one who activates first "wins".

4.3 Max Hold Time

PropertyValue
Default60 minutes (3600s)
Domain30s โ€” 86,400s (24 hours)
What doesThe maximum time the muzzle holds an open position

Explanation for beginners: Even if neither the stop nor the take profit has been activated, after this time the position is closed automatically. Prevents situations in which a position remains "blocked" whole hours without movement.

Example:


5. POSITION SIZING

These parameters control HOW the bot risks per transaction.

5.1 Risk Per Trade %

PropertyValue
Default2.0%
Domain0.1% โ€” 25.0%
What doesThe percentage of equity that he risks on a single trade

Explanation for beginners: This is the maximum loss you accept on a single transaction, expressed as a percentage of the total value of the account.

Example with $10,000 account and Risk Per Trade = 2%:

The classic rule: Most professional traders risk between 1-2% per trade. More than 5% is considered very risky.

5.2 Max Open Positions

PropertyValue
Default1
Domain1 โ€” 20
What doesThe maximum number of positions open simultaneously

Example:

Attention: With Max Open = 5 and Risk = 2%, the total risk can be 5 x 2% = 10% of the account simultaneously.

5.3 Max Daily Trades

PropertyValue
Default50
Domain1 โ€” 500
What doesThe maximum number of transactions per day

Example:


6. DISCOURSE ALERTS

what is it

The Discord Alerts section sends notifications to a Discord server when the bot does important actions.

How to configure (step by step)

  1. Create a Discord server (or use an existing one)
  2. Create a Webhook:
  1. Paste the URL in the "Webhook URL" field from HFT Engine
  2. Tick the desired alerts:
  1. Click TEST DISCORD โ€” check that the webhook is working

7. TELEGRAM ALERTS

what is it

Similar to Discord, but on Telegram. You receive notifications on your mobile phone.

How to configure (step by step)

  1. Create a Telegram Bot:
  1. Find out your Chat ID:
  1. Enter Bot Token in the corresponding field
  2. Enter Chat ID in the corresponding field
  3. Check "Enable Telegram Alerts"
  4. Click TEST TELEGRAM โ€” check that you receive the message

8. SAFETY LIMITS

8.1 Daily Loss Limit %

PropertyValue
Default3.0%
Domain0.5% โ€” 20.0%
What doesMaximum daily loss accepted

Explanation for beginners: When the total loss for the current day reaches this percentage of equity, the bot completely STOPS trading for the rest of the day.

Example with $10,000 account and Daily Loss = 3%:

Recommendations:


9. CORRELATION MATRIX

what is it

The correlation matrix shows how much the assets you trade move together.

elements

Max Corr (slider)

PropertyValue
Default0.70
Domain0.00 โ€” 1.00
What doesThe maximum correlation allowed between the assets held

Explanation: If two assets have a correlation of 0.95, they move almost identically. Holding both is like having double the position on one. The slider limits this correlation.

Example:

REFRESH button: Recalculates the correlation matrix with the current data.


10. PERFORMANCE PORTFOLIO

what is it

The Portfolio Performance panel shows the performance of each asset in the portfolio.

elements

What the table shows:


11. ATR DYNAMIC STOPS

ATR (Average True Range) measures the real volatility of an asset. These parameters set stops and take-profits based on volatility, not on fixed percentages.

11.1 Stop-Loss (x ATR)

PropertyValue
Default1.5x
Domain0.5x โ€” 5.0x
What doesStop loss as a multiple of ATR

Example: If AAPL's 14 period ATR is $3:

11.2 Take-Profit (x ATR)

PropertyValue
Default3.0x
Domain1.0x โ€” 10.0x
What doesTake profit as a multiple of ATR

Example: With ATR = $3:

11.3 Partial Take %

PropertyValue
Default50%
Domain25% โ€” 75%
What doesHow much of the position is closed at the first profit target

Explanation: Instead of closing the entire position at take profit, you close only a part (ex: 50%) and let the rest flow with a trailing stop.

Example: You have 100 AAPL shares. With Partial = 50%:

  1. At the first target: sell 50 shares, collect partial profit
  2. The other 50 continue with trailing stop
  3. If the price continues to rise, you also win the second half

11.4 Partial Profit Taking (checkbox)

Enables/disables partial profit taking. When it is disabled, the entire position is closed at take profit.


12. LLM SENTIMENT

what is it

Sentiment analysis based on AI (Large Language Models) that processes news and generates a sentiment score for traded assets.

elements

Elementswhat is he doing
API KeyAPI key from OpenAI or Anthropic
ProviderOpenAI (GPT-4o-mini) or Anthropic (Claude Haiku)
EnableEnable/disable sentiment analysis

How โ€‹โ€‹it works: The bot sends recent news about the asset to LLM and receives a sentiment score (bullish/bearish/neutral) which it includes in the trading decision.

Cost: Using LLMs involves costs per API call. GPT-4o-mini is the cheapest.


13. HEDGING OPTIONS

what is it

Hedging with options is a protection strategy: you buy put options (which increase in value when the price decreases) to protect long positions.

elements

13.1 OTM %

PropertyValue
Default5%
Domain1% โ€” 20%
What doesAs for "out of the money" to be the purchased options

Example: You have a long position on AAPL at $200. With OTM = 5%:

13.2 Max Premium %

PropertyValue
Default1.0%
Domain0.1% โ€” 5.0%
What doesHow much of the position value is spent on the option premium

13.3 Auto-Hedge (checkbox)

Activate automatic hedging. When ON, the bot automatically buys put options for long positions.

HEDGE ALL (button)

Apply hedging immediately on ALL open positions.


14. WEB DASHBOARD

what is it

A local web server that allows you to monitor the bot from your browser. Listen exclusively on 127.0.0.1 (localhost). It includes the HTML cyber-HUD page with live status, API endpoints JSON, and WebSocket for real-time push updates.

elements

Elementswhat is he doingDefault
EnableStarts/stops the web serverOFF
PortThe port it runs on (1024-65535)7777
URLAccess addresshttp://127.0.0.1:7777
COPY URLCopy the URL to the clipboardโ€”
TokenAuthentication token (automatically generated)Random 64-char hex
Rotate TokenRegenerate the instant token (command rotate_dashboard_token)โ€”

How โ€‹โ€‹to use:

  1. Tick โ€‹โ€‹"Enable"
  2. Open browser on http://127.0.0.1:7777
  3. The page is automatically authenticated with the embedded token

Security

Authentication (unified S02, extended S72): All HTTP endpoints use the Authorization: Bearer <token> header. The WebSocket endpoint /ws accepts tokens both in the header and via query parameter ?token=... (necessary because the WebSocket API browser does not support custom headers). The token can be found in settings. Without a valid token, you get 401 Unauthorized. The only exception: /api/health does not require authentication.

CORS (Cross-Origin Resource Security):

Rate Limiting:

Auth Failure Logging:

Token Rotation:

WebSocket (Real-Time Push)

Endpoint: /ws (Bearer authentication on HTTP upgrade request)

Message typeFrequencyWhat does it contain?
statusIn 2 secondsequity, positions[], breaker, latency p50/p95
tradeAt every tradeaction, symbol, side, pnl, duration_secs
alertAt watchdog recoverymessages

The JavaScript client has auto-reconnect with exponential backoff (1s โ†’ 30s).

API Endpoints

EndpointThe methodAuthWhat does it return?
/api/healthGETNot{"status":"ok","uptime_secs":N,"version":"..."}
/api/build-infoGETNot{"version":"...","git_hash":"...","build_date":"...","uptime_secs":N} (S04)
/GETBearerHTML dashboard page (cyber-HUD) with build tags
/api/statusGETBearerEquity, autopilot, breaker, strategy
/api/positionsGETBearerList of open positions
/api/tradesGETBearerLast 20 trades
/api/statsGETBearerWin rate, total PnL, profit factor
/api/autopilotPOSTBearerToggle autopilot ON/OFF
/wsGETBearerWebSocket live push

15. CORE AUTOPILOT

These 10 parameters control the fundamental engine of the autopilot โ€” the main trading loop.

15.1 Min Hold (s)

PropertyValue
Default180s (3 min)
Domain0 โ€” 3600s
What doesThe minimum time a position must be held

Explanation: After entering, the bot will not leave its position for at least this number of seconds, even if it receives an exit signal. Prevents premature noise exits.

Example: Min Hold = 180s โ†’ After you buy, the bot waits at least 3 minutes before considering the exit.

15.2 Consensus %

PropertyValue
Default70%
Range30% โ€” 100%
What it doesMinimum percentage of GPU Nexus agents that must agree

Explanation: GPU Nexus is running 150,000 agents of simulation. Consensus % sets how many must agree that a trade is good. 70% means that at least 105,000 agents must confirm.

15.3 Loop (ms)

PropertyValue
Default1500ms
Range500 โ€” 10,000ms
What it doesHow often does the autopilot loop run

Example: Loop = 1500ms โ†’ The bot checks the market 0.67 times per second. Loop = 500ms โ†’ Check 2 times per second (faster, but consumes more resources).

15.4 OFI Stale (ms)

PropertyValue
Default10,000ms (10s)
Range1,000 โ€” 60,000ms
What it doesAfter how many milliseconds the OFI data is considered "old"

Explanation: If the last OFI was received more than X ms ago, the bot ignores it and does not enter based on it.

15.5 Min Bars

PropertyValue
Default20
Range5 โ€” 200
What it doesMinimum number of candles (bars) required before the first entry

Explanation: The bot waits to have at least 20 price bars before making the first entry on an asset. Technical indicators (EMA, RSI, MACD) need enough data to calculate correctly.

15.6 OFI Entry Thr.

PropertyValue
Default5.0
Range0 โ€” 50 (displayed /10)
What it doesSpecific OFI Threshold for the input signal

Difference from OFI Threshold (Entry Parameters): This is the internal threshold of the autopilot, not the one in the entry module. Both must be satisfied.

15.7 Max Qty Cap

PropertyValue
Default1,000
Range1 โ€” 100,000
What it doesMaximum quantity of units (shares/coins) per order

Example: Max Qty = 1000 โ†’ The bot will not buy more than 1000 shares in a single order, regardless of how much the position sizing indicates.

15.8 Min Qty Thr.

PropertyValue
Default0.001
Range0.001 โ€” varies
What it doesMinimum quantity per order (below this, the order is not sent)

Explanation: Some assets (especially crypto) have very small lots. If position sizing calculates a quantity below the minimum threshold, the order is not sent.

15.9 Equity Fallback

PropertyValue
Default$10,000
Range$1,000 โ€” $1,000,000
What doThe equity value used if the Alpaca API does not respond

Explanation: If the bot cannot read the real equity from the account (network timeout, API error), it uses this value as a temporary reference. Prevent orders with abnormal sizes.

15.10 Max Bypass Risk %

PropertyValue
Default25%
Range1% โ€” 100%
What it doesMaximum risk allowed in bypass mode (manual override)

15.11 Generation-Aware Loop (S03)

Autopilot captures session_generation at startup. At each tick, check if the current generation matches. If not (eg: after a watchdog respawn), the old loop exits automatically:

"Generation mismatch โ€” exiting stale autopilot instance"

This prevents operational split-brain: two instances of autopilot trading simultaneously after a respawn. The same protection applies to trade_updates and streamer.

Generation-critical loops: streamer, autopilot, trade_updates. The generation is automatically incremented by spawn_loop_by_name only for these three.


16. EXIT SCALING

These 17 parameters control how stop-loss, take-profit and trailing stop are calculated depending on volatility and trading mode.

16.1 Vol Factor Min / Max

ParameterDefaultRange
Vol Factor Min0.60.1 โ€” 2.0
Vol Factor Max2.51.0 โ€” 10.0

What they do: Limits the volatility factor that adjusts the stops. If the volatility is very low, the factor does not fall below Min; if it is very high, it does not exceed Max.

Example: With Vol Min = 0.6 and trail of 1.5%:

16.2 Fallback SL / TP / Trail %

ParameterDefault
Fallback SL %2.5%
Fallback TP %2.5%
Fallback Trail %1.5%

What I do: Backup values used when the dynamic calculation (based on ATR/volatility) fails or returns invalid values.

16.3 Scalp Stop / Take / Trail Mult

ParameterDefault
Scalp Stop Mult0.70
Scalp Take Mult0.60
Scalp Trail Mult0.50

What I do: In scalping mode, stop/take/trail are MULTIPLYED with these multipliers, making them tighter.

Example: With trail of 1.5% and Scalp Trail Mult = 0.50:

16.4 Partial 1st Target / Min Qty

ParameterDefaultWhat it does
Partial 1st Target0.5 (50%)Fraction of position closed at the first target
Partial Min Qty0.001Minimum quantity remaining after partial close

16.5 ATR Period

PropertyValue
Default14
Range2 โ€” 100
What it doesNumber of periods for ATR calculation

Explanation: An ATR with 14 periods it uses the last 14 candles to calculate average volatility. Bigger = smoother, smaller = more reactive.

16.6 ATR Stop/Take/Trail Clamp Min/Max

ParameterDefault MinDefault Max
ATR Stop Clamp0.58.0
ATR Take Clamp1.015.0
ATR Trail Clamp0.35.0

What I do: Limits ATR-based stop/take/trail values to a reasonable range. It prevents extreme values โ€‹โ€‹when volatility explodes.


17. ORACLE EXIT

These 6 parameters control the exits based on Oracle AI (the bot's artificial intelligence system).

17.1 Exit Min Conf.

PropertyValue
Default0.40
Range0 โ€” 1.00
What it doesOracle's minimum confidence to trigger exit

Example: The Oracle analyzes the market and says "I am 60% sure that the price will decrease". With Exit Min Conf = 0.40, this confidence (0.60) exceeds the threshold, so the bot exits.

17.2 Exit Min Score

PropertyValue
Default30
Domain0 โ€” 100
What doesThe minimum score of the Oracle output signal

17.3 Flip Score Thr.

PropertyValue
Default10
Domain0 โ€” 100
What doesThe score at which the Oracle considers the market to have "turned" (flip)

Example: You are long (you bought). The Oracle detects a sell score = 15, with Flip Thr = 10. The score exceeds the threshold โ†’ The bot considers that the market has turned and exits.

17.4 Flip Confidence

PropertyValue
Default0.20
Domain0 โ€” 1.00
What doesMinimum confidence to confirm the flip

17.5 Chaos Max Loss %

PropertyValue
Default-0.5%
Domain-10.0% โ€” 0%
What doesThe maximum loss accepted in chaotic mode

Explanation: When the Oracle detects that the market is in CHAOTIC mode, it applies a much tighter stop. If the loss reaches this percentage, it comes out immediately.

17.6 Chaos Min Conf.

PropertyValue
Default0.25
Domain0 โ€” 1.00
What doesOracle's minimum confidence to declare chaotic regime

18. CIRCUIT BREAKER

Account protection system. The most important safety mechanism.

18.1 Deposit %

PropertyValue
Default-3.0%
Domain-20% โ€” 0%
What doesDaily loss threshold for CAUTION mode

Example with $10,000 account: When you lose $300 (3%) in one day โ†’ CAUTION is activated. The bot becomes more conservative (does not enter weak signals).

18.2 Halt %

PropertyValue
Default-5.0%
Domain-30% โ€” 0%
What doesDaily loss threshold for HALT mode

Example: Lose $500 (5%) โ†’ HALT. The bot completely STOPS new entries. Existing positions continue to be managed (stop/trail).

18.3 Panic %

PropertyValue
Default-8.0%
Domain-50% โ€” 0%
What doesDaily loss threshold for PANIC mode

Example: You lose $800 (8%) โ†’ PANIC. The bot CLOSES ALL positions and stops trading completely for the current day.

18.4 Max Notional Frac

PropertyValue
Default0.25 (25%)
Domain0.01 โ€” 1.00
What doesThe maximum fraction of equity that a single position can represent

Example with $10,000 account: Max Notional = 0.25 โ†’ A single position cannot exceed $2,500 notional value.

18.5 Min Stop Frac

PropertyValue
Default0.0001 (0.01%)
Domain0.0001 โ€” 0.01
What doesThe minimum stop distance as a fraction of the price

Explanation: Prevents too tight stops that would activate on noise. With 0.0001 on AAPL at $200, the minimum stop is at $200 x 0.0001 = $0.02 distance.

18.6 Flash Crash Detector

The Flash Crash Detector system monitors the price movement in real time and acts automatically when it detects abnormal market dislocations.

Difference from Circuit Breaker: Circuit Breaker measures your PnL (losses from positions). The Flash Crash Detector measures market price movement โ€” it can detect a crash before your stop is hit.

18.6.1 Flash Crash Window (seconds)

PropertyValue
Default30 seconds
Range5 โ€” 120
What it doesTime window in which monitors price movement

Explanation: The bot keeps track of all prices received in the last N seconds. If the difference between the maximum and minimum price in this window exceeds the threshold, a flash crash is declared.

Example: Window = 30s, AAPL trades at $200. In the last 30 seconds, the price was between $195 and $200 โ†’ variation = (200-195)/195 ร— 100 = 2.56%. If the threshold is 3%, it is not activated.

18.6.2 Flash Crash Threshold (%)

PropertyValue
Default3.0%
Range0.5 โ€” 20.0
What it doesThe percentage of price movement that triggers the protection

Explanation: If the price moves by more than X% in the monitoring window (in any direction โ€” up or down), the bot considers it an abnormal dislocation and activates the protection.

Recommendations:

18.6.3 Flash Crash Cooldown (minutes)

PropertyValue
Default5 minutes
Range1 โ€” 60
What it doesHow long it blocks new entries on the affected symbol after a flash crash

Explanation: After detecting a flash crash on a symbol, the bot blocks any new entry on that symbol for N minutes. It prevents re-entry into an unstable market.

What happens when Flash Crash Detector is activated?

5 automatic actions, in order:

  1. Log โ€” detailed log recording with component="flash_crash"
  2. Frontend event โ€” emit "flash-crash" to UI (toast/visual alert)
  3. Auto-close โ€” automatically closes the open position on the affected symbol
  4. Telegram alert โ€” sends notification on Telegram (if enabled)
  5. Block โ€” blocks new entries on that symbol for cooldown minutes

18.7 Drawdown Velocity Detection

The Drawdown Velocity Detection system monitors the speed with which the drawdown increases and can block the inputs BEFORE the Circuit Breaker activates.

Difference to Circuit Breaker: Circuit Breaker measures how much you lost (magnitude). Drawdown Velocity measures how fast you lose (velocity). It can detect cascading losses in progress minutes before the absolute threshold is reached.

Difference from Flash Crash Detector: Flash Crash measures the price movement of the market. Drawdown Velocity measures the speed of your loss (of your equity).

18.7.1 DD Velocity Threshold (%/min)

PropertyValue
Default-1.0 %/min
Range-10.0 ... -0.1
What doesMaximum tolerated loss speed, in percentage of peak equity per minute

Explanation: If the drawdown increases by more than X% per minute (on the lookback window), the bot blocks all new entries. The value is negative by convention (the loss is negative).

Examples:

Recommendations:

18.7.2 DD Velocity Window (seconds)

PropertyValue
Default300 seconds (5 minutes)
Range30 โ€” 600
What it doesThe time window over which the drawdown speed is calculated

Explanation: The speed is calculated by comparing the current drawdown with the one from N seconds ago. Shorter window = faster reaction but more sensitive to short spikes. Longer window = more stable but slower reaction.

Recommendations:

What happens when DD Velocity Halt activate?

  1. Block entries โ€” all new entries are blocked (independent of the Circuit Breaker)
  2. Log โ€” periodic message in the UI: "DD VELOCITY HALT โ€” Drawdown speed X.XX%/min exceeds threshold"
  3. Automatic recovery โ€” when the speed drops below the threshold, the entries are automatically re-activated (does not require a manual reset as in Circuit Breaker)
  4. Existing positions are not affected โ€” only applies to new entries

Visible in API: get_risk_status returns field dd_velocity (f64). Negative value = increasing drawdown. Value close to 0 = stable.

18.8 Global Breaker Synchronization with SmartTrend (S69)

From Session 69, reset_circuit_breaker also resets the SmartTrend status: st_account.breaker_triggered, st_account.paused, settings.st_bot_paused. Daily reset does the same when the breaker was active. Badge BRK:SYNC in ST SHIELD visually confirms that the two systems are synchronized.


19. STRATEGY SCORING

These 9 parameters control the strategy scoring engine โ€” how the bot evaluates the quality of each input signal.

19.1 Base Score

PropertyValue
Default50
Range0 โ€” 100
What it doesBase Score at which the evaluation starts

Explanation: The strategy starts with this score and adds/subtracts points based on the indicators. A high final score (eg: 75+) indicates a good input signal.

19.2 VPIN Gate Scalp / Normal

ParameterDefault
VPIN Gate Scalp0.85
VPIN Gate Normal0.75

What I do: VPIN (Volume-Synchronized PIN) measures flow toxicity. If the VPIN exceeds the threshold, the bot DOES NOT enter โ€” the market is too "toxic" (probably insider trading or flow opponent).

19.3 Min RVOL

PropertyValue
Default0.5
Range0 โ€” 5.0
What it doesRelative volume minimum required

Explanation: RVOL = current volume / historical average. RVOL = 0.5 means that the volume must be at least 50% of the average. RVOL = 2.0 would require twice the average volume.

19.4 RVOL Window

PropertyValue
Default20
Range5 โ€” 200
What it doesHow many periods are used for volume averaging

19.5 RVOL Relax Thr. / Val.

ParameterDefaultWhat it does
RVOL Relax Thr.3.0If RVOL exceeds this value, it "relaxes" filter
RVOL Relax Val.5.0The replacement value when relaxing

Explanation: When the volume is VERY high (3x the average), it is probably a major event and the normal RVOL filter would be too restrictive.

19.6 Chaos Conf Kill / Chaos Regime Mult

ParameterDefaultWhat it does
Chaos Conf Kill0.10Confidence under which the score cancels in chaos
Chaos Regime Mult0.55The multiplier applied to the Oracle contribution in chaotic mode

20. ENGINE STOPS

These 6 parameters control the stops and trailing in the trading engine (function manage_positions).

20.1 Long Stop Normal %

PropertyValue
Default-2.5%
Range-20% โ€” 0%
What it doesFixed stop loss for long positions in normal mode

20.2 Long Stop Aggr %

PropertyValue
Default-8.0%
Range-30% โ€” 0%
What doFixed stop loss for long positions in aggressive mode

Difference: Aggressive mode allows wider stops to give the position room to breathe.

20.3 Short Stop %

PropertyValue
Default-5.0%
Range-20% โ€” 0%
What it doesStop fixed loss for short positions

20.4 Long Trail Min Profit %

PropertyValue
Default1.5%
Range0.1% โ€” 10%
What it doesMinimum profit required before activating trailing stop on long

Example: With Min Profit = 1.5% and long position on AAPL at $200:

20.5 Short Trail Gap %

PropertyValue
Default1.5%
Domain0.1% โ€” 10%
What it doesTrailing stop distance on short positions

20.6 Short Trail Min Profit %

PropertyValue
Default1.0%
Range0.1% โ€” 10%
What it doesMinimum profit required to activate trailing stop on short

21. ORACLE FUSION

These 8 parameters control the weights and thresholds in the 7-layer Oracle AI system.

21.1 Kalman W / Entropy W / Hurst W / VPIN W / Wavelet W

ParameterDefaultWhat measure
Kalman W0.30Kalman filter โ€” price direction estimation
Entropy W0.25Entropy โ€” degree of market disorder
Hurst W0.20Hurst exponent โ€” trend persistence
VPIN W0.15VPIN โ€” flow toxicity
Wavelet W0.10Wavelet โ€” price frequency decomposition

Explanation: Oracle combines 5 metrics into a final score. Weights (W) determine how much each metric matters.

Example: With Kalman W = 0.30 and Entropy W = 0.25, price direction (Kalman) matters more than market disorder (Entropy).

Recommendation: The sum of the weights should be close to 1.00 (not mandatory, but logical). Default: 0.30 + 0.25 + 0.20 + 0.15 + 0.10 = 1.00.

21.2 Conf Floor

PropertyValue
Default0.25
Range0 โ€” 1.00
What it doesOracle's minimum confidence below which the signal is ignored

21.3 Entropy Chaos Thr.

PropertyValue
Default0.85
Range0 โ€” 1.00
What it doesThe entropy threshold above which the market is declared CHAOTIC

21.4 VPIN Toxicity Alert

PropertyValue
Default0.60
Range0 โ€” 1.00
What it doesVPIN threshold above which the toxicity alert is issued

22. INDICATOR PERIODS

These 12 parameters set the periods of classic technical indicators. Their modification DIRECTLY affects the BUY/SELL signals on the chart.

22.1 EMA Fast / Mid / Slow / Trend

ParameterDefaultWhat it does
EMA Fast9Fast exponential moving average (fast reaction to price)
EMA Mid20Average moving average
EMA Slow50Slow moving average (medium term trend)
EMA Trend200Trend moving average (long term trend)

How the crossover works:

Example: With EMA Fast = 9 and EMA Slow = 50:

22.2 RSI Period

PropertyValue
Default14
Range2 โ€” 100
What it doesPeriod Relative Strength Index

Explanation: RSI measures the speed and magnitude of price movements. RSI < 30 = oversold (potential cumparare), RSI > 70 = overbought (potential sale).

22.3 MACD Fast / Slow / Signal

ParameterDefault
MACD Fast12
MACD Slow26
MACD Signal9

Explanation: MACD = difference between two EMAs. Signal line = EMA of MACD. MACD crossover above Signal = bullish, below = bearish.

22.4 BB Period / BB Std Dev

ParameterDefaultWhat it does
BB Period20Bollinger Bands Period
BB Std Dev2.0Number of standard deviations

Explanation: Bollinger Bands = moving average +/- N standard deviations. The price below the lower band = potentially oversold, above the upper band = potentially overbought.

22.5 ADX Period

PropertyValue
Default14
Range2 โ€” 100
What it doesPeriod Average Directional Index

Explanation: ADX measures the strength of the trend (not the direction). ADX > 25 = strong trend, ADX < 20 = side square.

22.6 StochRSI Period

PropertyValue
Default14
Range2 โ€” 100
What it doesStochastic RSI Period

Explanation: StochRSI applies the Stochastic formula to the RSI, generating a more sensitive oscillator (0-1). Below 0.2 = oversold, above 0.8 = overbought.


23. ADAPTIVE EXIT MULTIPLIERS

This is the most advanced section of the HFT Engine. Control how the bot automatically adjusts stop/take/trail depending on the market regime, signal alignment and timeframe.

How the cascade works

The final stop/take/trail values are calculated as follows:

Valoare efectiva = Valoare baza x Regime Mult x Signal Mult x TF Mult

Full example:

Trailing-ul s-a comprimat de la 1.5% la 0.743% pentru ca piata e haotica, dar semanalele sunt aliniate.

23.1 DISABLE ADAPTIVE EXITS (toggle)

When ON, ALL multipliers are ignored. The bot only uses the raw values โ€‹โ€‹from the Entry/Exit sliders. Useful if you want total control without automatic adjustments.

23.2 Min Exit Floor %

PropertyValue
Default0.30%
Range0.05% โ€” 5.00%
What it doesThe minimum value to which stop/take/trail can be compressed

Explanation: Even if cascading multipliers would produce a value of 0.01%, Exit Floor prevents this โ€” stop/take/trail will never be lower than 0.30%.

23.3 Regime Multipliers (9 sliders)

Each market regime has separate multipliers for Stop, Take and Trail:

ModeStop (default)Take (default)Trail (default)
Chaotic0.70x0.60x0.50x
Range0.85x0.75x0.85x
Trend1.05x1.30x1.10x

Logic:

Example CHAOTIC: Base Trail = 1.5%, Chaotic Trail = 0.50x โ†’ Effective Trail = 0.75%. The muzzle comes out faster in chaos.

TREND Example: Base Take = 2.5%, Trend Take = 1.30x โ†’ Effective Take = 3.25%. The bot lets the profit grow in the trend.

23.4 Signal Alignment Multipliers (5 sliders)

ParameterDefaultWhen applied
Aligned Stop x1.10xWhen signals confirm the position
Aligned Take x1.25xWhen signals confirm position
Aligned Trail x1.10xWhen signals confirm position
Oppose Stop x0.85xWhen signals contradict position
Oppose Take x0.80xWhen the signals contradict the position

Logic:

23.5 Timeframe Multipliers (3 sliders)

ParameterDefault
Short TF Stop x0.90x
Short TF Take x0.90x
Short TF Trail x0.90x

What I do: On short timeframes (1m, 3m), stop/take/trail are tighter (x 0.90). On long timeframes, a neutral multiplier (1.0x) is applied.


24. MULTI-ASSET CONTROL

Toggle MULTI-ASSET TRADING

StatusWhat it means
OFFThe bot trades only one asset at a time
ONThe bot can trade multiple assets simultaneously

Max Concurrent Assets

PropertyValue
Default5
Range1 โ€” 100
What it doesMaximum number of assets traded simultaneously

Example: With Max Concurrent = 5, the bot can have open positions simultaneously on AAPL, TSLA, BTC/USD, ETH/USD and MSFT. The 6th asset is ignored until one of the positions is closed.

Caution: More assets at once = more exposure. Make sure the equity supports it.


25. EFFECTIVE EXIT VALUES

What is it?

The panel "EFFECTIVE EXIT VALUES" shows the REAL values โ€‹โ€‹the bot uses for stop/take/trail AFTER applying all the adaptive multipliers.

How to read

ElementWhat it looks likeColor
STOP LOSSEffective stop loss percentageRed
TAKE PROFITEffective take percentage profitGreen
TRAILINGThe effective trailing stop percentageGold

Under each effective value, base: โ€” the gross value from the slider, without multipliers, also appears.

Example:

It updates automatically when you change any slider.


26. REGIME HEATMAP

What is it?

Three colored boxes that visually show the active multipliers for each market regime and highlight the CURRENT regime.

How to read

Each box shows:

The active mode box has a shiny outline and a brighter background.

Example:

[TRENDING]        [RANGE]           [CHAOTIC]
 S:1.05x          S:0.85x           S:0.70x    โ† activ (highlight)
 T:1.30x          T:0.75x           T:0.60x
 Tr:1.10x         Tr:0.85x          Tr:0.50x

If the CHAOTIC box is highlighted, it means that the Oracle has detected chaos on the market and the CHAOTIC multipliers are active.

It updates automatically every 5 seconds.


27. PARAMETER PROFILES (Disk Persistence)

What is it?

A system of named profiles that allows saving and loading complete configurations. Profiles are stored on disk in titan_profiles.json -- they survive rebuilds, crashes, and can be exported/imported between instances.

How to create a profile

  1. Configure all the sliders as you want
  2. Click SAVE CONFIG (save to disk)
  3. Write a name in the "Profile name..." field. (ex: "Crypto Scalp Night")
  4. Click SAVE AS
  5. The profile appears in the dropdown

How to load a profile

  1. Select the profile from the dropdown
  2. Click LOAD
  3. ALL parameters are restored -- including TA Gates, Scan Params, Symbol Overrides (nested objects)
  4. An undo snapshot is automatically created before load

How to delete a profile

  1. Select the profile from the dropdown
  2. Click DELETE
  3. Confirm the deletion in the cyber dialogue
  4. The profile is permanently deleted from the disk

How to export/import a profile

  1. EXPORT: Select the profile, click EXPORT -- se download a file titan_profile_<name>.json
  2. IMPORT: Click IMPORT, select the JSON file -- the profile is imported to disk (the name is taken from the file or from the text field)

Import validations (from Session 44):

Automatic migration

If you have old profiles from localStorage (previous versions), they are automatically imported to disk on the first run and the old key is deleted.

Practical use:


28. RISK CALCULATOR LIVE

What is it?

Panel with 4 risk metrics calculated in real time from the current settings.

Metrics

MetricWhat it showsColor
MAX LOSS / TRADEMaximum possible loss on a single trade, in dollarsRed
POSITION SIZESize of the position in dollarsBlue
RISK/REWARDThe ratio between the assumed risk and the target profitGreen
MAX DAILY LOSSThe maximum daily loss in dollarsGold

Example with $10,000 account, Risk = 2%, Stop = 1.5%, Take = 2.5%:

It is updated automatically when you change the sliders.


29. PARAMETER HEALTH

What is it?

An automatic diagnostic system that checks 15 conflict/risk rules and displays warnings.

Types of badges

BadgeColorWhat it means
OKGreenEverything is fine
WARNOrangeCaution โ€” possibly suboptimal
DANGERPurpleDanger โ€” risky setting

Examples of checked rules

It is updated in real time with any slider change.


30. AUTO-SUGGEST

What is it?

Function that analyzes the last 50 trades in the log and generates automatic suggestions for adjusting the parameters.

How to use it

  1. Click ANALYZE TRADES
  2. The bot analyzes the results from the log
  3. Cards with suggestions are displayed
  4. Each suggestion has an APPLY button that automatically applies the adjustment
  5. Click CLOSE when you are done

Examples of suggestions

7 patterns detected

  1. High stop-out rate
  2. Average profit too low
  3. Frequent exits on max hold
  4. Ratio suboptimal risk/reward
  5. Too many daily trades
  6. Losses concentrated on one certain asset
  7. Trailing stop ineffective (never activates)

31. PER-SYMBOL OVERRIDES

What is it?

Allows the setting of CUSTOM parameters per symbol, which override the global settings for that asset only.

How to set an override

  1. Open the section (click on "PER-SYMBOL OVERRIDES")
  2. Write the symbol in the "Symbol" field. (ex: AAPL)
  3. Fill in the desired fields:
  1. Click SET

How to delete a override

  1. Write the symbol in the "Symbol" field
  2. Click REMOVE

Practical example

Global settings: Trail = 1.5%, Take = 2.5%, Risk = 2.0%

Override for BTC/USD: Trail = 3.0%, Take = 5.0% (crypto is more volatile, so wider stops)

Override for AAPL: Risk = 1.0% (stable stock, lower risk)

The list of active overrides is displayed below the buttons.


32. PRESET BAR

Bar of presets and global controls at the bottom of the tab.

Elements (from left to right)

ElementWhat it does
SearchFilter sliders by name
SAFE DEFAULTApply conservative preset to ALL sliders
Lock SAFESwitch on/off โ€” lock the SAFE preset
SCALP DEFAULTApply aggressive scalping preset
Lock SCALPSwitch on/off โ€” lock the SCALP preset
SAVE CONFIGSave the settings current on disk
EXPORTExport the configuration in a JSON file
IMPORTImport the configuration from a JSON file
UNDORestore the settings before the last modification
SHOW CHANGESDisplays a table with unsaved changes

Write in the search field and only the sliders that contain the text remain visible. Completely empty sections are hidden.

Example: Write "trail" โ†’ Only sliders with "trail" appear. in names: Trailing Stop, Scalp Trail Mult, ATR Trail Min, etc.

Preset locks

When a lock is ON:

EXPORT / IMPORT

UNDO

It restores the settings to the state before the last important change (applied preset, import, etc.). It is saved on disk in titan_settings_undo.json, so it survives restart. From Session 44, UNDO uses the same apply_full_settings command as import โ€” it sends the complete snapshot as JSON typed, ensuring faithful restoration including for complex fields.

Batch Update Transactional (Session 44)

When applying a preset or changing several parameters simultaneously, batch_update_settings uses a snapshot + rollback mechanism:

  1. A clone of the current state is made
  2. Each parameter is applied individually
  3. If any one fails โ€” all state returns to the snapshot (full rollback)
  4. Save to disk and runtime synchronization only after complete success

Result: there is no more risk of partially saved configuration on disk after an error.


33. SETTINGS DIFF PANEL

what is it

Displayable panel through the SHOW CHANGES button that shows a table with ALL unsaved changes.

How to read

ColumnWhat does it look like?
ParameterThe name of the changed setting
SavedValue that is on disk (last save)
CurrentThe current value in the slider

Different values โ€‹โ€‹are highlighted in color:

Example:

Parametru          | Salvat | Curent
trailing_stop_pct  |  1.5%  |  2.0%   โ† modificat
take_profit_pct    |  2.5%  |  3.0%   โ† modificat
risk_per_trade     |  2.0%  |  2.0%   (nemodificat โ€” nu apare)

Only MODIFIED parameters appear in the table. If there are no changes, "No unsaved changes" is displayed.


34. DRY RUN vs LIVE

The DRY/LIVE badge

The badge in the right corner of the title shows the bot's current mode:

ModeBadgeWhat does the bot do?
DRY RUNBlueSIMULATE trading โ€” do not send real orders
LIVEGreen (flashing)EXECUTE real orders on the market

How it changes

The badge is changed from the main sidebar (not from the HFT Engine). In HFT Engine it is only a readonly indicator.

Attention: In LIVE mode, every decision of the bot translates into REAL orders with REAL money. Make sure all settings are correct before going LIVE.

Default (S72): Fresh install starts with dry_run_enabled: true. Live trading must be activated explicitly. When live trading is active, the UI displays a pulsating red border + banner LIVE TRADING โ€” DRY RUN OFF.


35. PERSISTENCE OF SETTINGS

Where is it saved?

SetFile on diskLocation
All HFT Engine parameterstitan_settings.jsonThe config folder of the application
Undo snapshottitan_settings_undo.jsonNext to titan_settings.json
Chart settingstitan_chart_settings.jsonNext to titan_settings.json
profile sitestitan_profiles.jsonNext to titan_settings.json (+ auto-backup .bak)
Preset lockslocalStorageInternal Browser/WebView

What survives the restart

EventHFT settingsProfilesLocks
Toggle between tabsYESYESYES
Close + reopen the applicationYESYESYES
Application crashYESYESPossible
Rebuild with build.shYESYESNOT*

(*) build.sh can clear the WebView cache (localStorage). Settings from titan_settings.json and profiles from titan_profiles.json always survive -- they're on disk, not in the browser.

How is it saved?

  1. Change the sliders as you wish
  2. Click SAVE CONFIG
  3. Toast "Settings saved" confirm
  4. The settings are on the disk and will be restored at the next start

Attention: If you change the sliders but do NOT SAVE CONFIG, the changes are lost on restart.

Persistence Protections (S72)

Runtime Sync (from Session 44)

At each save / load profile / batch update, the apply_runtime_config() function automatically synchronizes the runtime fields in TitanState with the saved values. Synchronized fields: strategy_mode, nexus_fusion_alpha, dry_run, circuit_breaker thresholds, flash_crash params, smarttrend config. No manual action is needed to ensure consistency between settings and runtime.

S08 Update: StrategyMode now includes 5 variants: MathOracle, GpuNexus, Fusion, SignalStrategy, SmartTrend. SmartTrend mode activates the dedicated scoring pipeline (SmartTrendEngine with FSM, markers ST BUY/SELL/EXIT/TRAIL/STALK/BREAK, kill switch with confirm token). When st_killed == true, autopilot blocks all SmartTrend entries.


36. RECOMMENDATIONS AND TIPS

For beginners

  1. Start with DRY RUN โ€” test a few days in simulation before LIVE
  2. Use SAFE DEFAULT โ€” conservative values โ€‹โ€‹are the safest to begin with
  3. Do not change all parameters at once โ€” change one parameter at a time and observe the effect
  4. Monitor Parameter Health โ€” if you see DANGER, correct it before going LIVE
  5. Risk Per Trade below 2% โ€” the golden rule of risk management
  6. Export configuration โ€” before experimenting, export the settings as a backup

For advanced

  1. Create profiles per market โ€” different settings for crypto vs stocks
  2. Use Per-Symbol Overrides โ€” fine-tune on individual assets
  3. Adjusts Adaptive Multipliers โ€” customizes the response to regimes
  4. Monitor Regime Heatmap โ€” understand which regime is active and how it affects trades
  5. Run Auto-Suggest โ€” after 50+ trades, analyze the patterns

Frequent mistakes to avoid

  1. Stop > Take โ€” you lose more than you win on each trade
  2. Circuit Breaker too weak โ€” you can lose the whole account in one day
  3. Max Positions too high with high Risk โ€” total exposure can exceed 50% of the account
  4. Adaptive Exits disabled without understanding โ€” you lose protection in the chaotic market
  5. Ignoring UNDO โ€” after a wrong change, UNDO save

37. GLOSSARY

TermExplanation
ATRAverage True Range โ€” measures average volatility over N periods
Bollinger BandsBands around the moving average, based on standard deviation
Circuit BreakerSafety system that stops trading at large losses
CrossoverWhen one line crosses over/under another (trading signal)
DRY RUNSimulation โ€” the bot calculates but does not send real orders
EMAExponential Moving Average โ€” weighted average with emphasis on recent data
EntropyMeasure of disorder/chaos in price movements
Flash CrashExtreme and rapid price movement; the automatic detector closes positions and blocks entries (see ยง18.6)
EquityTotal account value (cash + open positions)
Hurst ExponentPersistent trend measure (>0.5 = trending, <0.5 = mean-reverting)
HFTHigh-Frequency Trading โ€” high-frequency trading
Kalman FilterEstimation algorithm that predicts price direction
LIVEReal mode โ€” the bot sends real orders with real money
MACDMoving Average Convergence/Divergence โ€” trend and momentum indicator
NotionalTotal dollar value of a position
OFIOrder Flow Imbalance โ€” imbalance between buy and sell orders
OracleAI system of bot with 7 layers of analysis
OverboughtPrice too high compared to the average, potential for downward correction
OversoldPrice too low compared to the average, potential for an upward return
RegimeCurrent state of the market: Trending, Range or Chaotic
RSIRelative Strength Index โ€” momentum oscillator (0-100)
RVOLRelative Volume โ€” current volume compared to the historical average
ScalpingTrading strategy with very short positions (seconds-minutes)
SpreadThe difference between the purchase price (ask) and the sale price (bid)
StochRSIStochastic RSI โ€” RSI applied to RSI, more sensitive
Stop LossThe order that closes the position at the set maximum loss
Take ProfitThe order that closes the position at the target profit
Trailing StopStop that moves with the price in the direction of profit
VPINVolume-Synchronized PIN โ€” measures the toxicity of the flow
WaveletFrequency decomposition of the price
DD VelocityThe speed with which the drawdown increases, measured in %/min โ€” see ยง18.7
Command PaletteQuick command search overlay, activated with Ctrl+K โ€” see ยง38

38. KEYBOARD SHORTCUTS AND COMMAND PALETTE

Titan HFT offers a set of global shortcuts for quick actions in scalping and a palette of commands with fuzzy search.

38.1 Direct Shortcuts

They work at any time (regardless of the active tab), except when the focus is on an input field or texting.

Short cutActionObservations
Ctrl+KOpen the Command PaletteIt always works, including from the input
Ctrl+EnterQuick BuyPlace a market buy order on the chart symbol
Ctrl+Shift+EnterQuick Sell (market)Place a market sell order on the chart symbol
Ctrl+Shift+XFlatten AllLiquidate ALL positions (emergency liquidated)
Ctrl+PToggle AutopilotTurns the autopilot on/off
Ctrl+]Longer timeframeCycle: 1m โ†’ 3m โ†’ 5m โ†’ 10m โ†’ 15m โ†’ 30m โ†’ 1h โ†’ 4h โ†’ 1d
Ctrl+[Shorter timeframeIt cycles in the opposite direction: 1d โ†’ 4h โ†’ 1h โ†’ ... โ†’ 1m

38.2 Command Palette (Ctrl+K)

Press Ctrl+K from anywhere in the application to open the command palette.

How โ€‹โ€‹it works:

  1. An overlay appears with a search field and list of orders
  2. Type to filter commands (fuzzy search)
  3. Navigate with Arrow Up/Down and confirm with Enter
  4. Or click on the desired order
  5. Escape closes the palette

19 orders available:

CategoryCommandShortcut (if any)
TradeQuick BuyCtrl+Enter
TradeQuick Sell (market)Ctrl+Shift+Enter
TradeFlatten All PositionsCtrl+Shift+X
ControlToggle AutopilotCtrl+P
NavigateGo to Chartโ€”
NavigateGo to AI Newsโ€”
NavigateGo to Journalโ€”
NavigateGo to HFT Engineโ€”
NavigateGo to Performanceโ€”
NavigateGo to AI Scannerโ€”
NavigateGo to Watchlistโ€”
NavigateGo to HFT Targetsโ€”
ChartTimeframe HigherCtrl+]
ChartTimeframe LowerCtrl+[
ChartTimeframe โ†’ 1mโ€”
ChartTimeframe โ†’ 5mโ€”
ChartTimeframe โ†’ 15mโ€”
ChartTimeframe โ†’ 1hโ€”
ChartTimeframe โ†’ 1dโ€”

Symbol switch: If the text entered in the palette does not correspond to any command, pressing Enter treats it as a trading symbol and switches the chart to that symbol. Example: Ctrl+K โ†’ "TSLA" โ†’ Enter = the chart changes to TSLA.

38.3 Compatibility with Chart Hotkeys

Existing chart shortcuts (L=line, R=ray, H=hline, V=vline, F=fib, T=text, M=measure, C=crosshair, A=alert, P=replay) still work normally. They are activated only without Ctrl, so they do not interfere with the Ctrl+* shortcuts above.


39. TA ENTRY GATES โ€” PRE-ENTRY FILTERS WITH SOFT/HARD MODE

The "TA ENTRY GATES" section (with an orange title) appears in the HFT Engine tab, just above Strategy Scoring. It contains 6 technical filters that are applied after the Oracle decides Buy/Short, but before executing the entry.

39.1 How it works

Each gate checks a technical indicator and can either penalize the score (Soft) or block the entry completely (Hard).

ModeEffectWhen you use it
OffThe gate does nothingYou don't want this filter
SoftThe trade score is reduced by Soft Penalty pointsYou want feedback, but you don't want to block
HardThe entry is completely blocked (the order is not placed)You want a guarantee that you do not enter in bad conditions

39.2 The 6 Gates

GateIndicatorWhen it is activated
RSIRelative Strength IndexLong when RSI > overbought (70). Short when RSI < oversold (30)
EMA AlignEMA 9/20/50Long when EMAs are not aligned bullish. Short when they are not decreasing
ADXAverage Directional IndexWhen ADX < threshold (25) โ€” trend too weak to enter
BB SqueezeBollinger Bands widthWhen the bands are too narrow (< 2% of average price) โ€” consolidation
MACDMACD HistogramLong cand histogram < 0. Short cand histogram > 0
Stoch RSIStochastic RSILong when Stoch > 80. Short when Stoch < 20

RSI Thresholds (rsi_overbought, rsi_oversold) and ADX** (adx_trend_threshold) are the ones already existing in the Classical Filters section. They do not need to be configured separately.

39.3 Presets

The dropdown to the right of the title allows quick selection of a predefined profile:

PresetWhat it sets
StrictAll 6 gates on Hard โ€” maximum quality, few inputs
BalancedRSI + ADX on Soft, the rest Off โ€” moderate filter
Oracle OnlyAll Off (default) โ€” Oracle decides by itself

After selecting a preset, you can manually adjust the individual gates. The dropdown returns to "Custom" to any manual modification.

39.4 Soft Penalty

The slider under the gate grid controls how many points are deducted from the score per Soft gate violated.

PropertyValue
Default15
Domain1 โ€” 50
What it doesPenalty per gate Infringed software

Penalties are accumulate. If 3 Soft gates are violated simultaneously and penalty = 15, the score decreases by 45 points. A low enough score prevents natural entry (it falls below the regime threshold).

39.5 Fail-Open on Lack of Data

If an indicator is None (there are not enough candles for calculation โ€” RSI requires 14, ADX 14, EMA50 requires 50), the respective gate is skipped. It does not block or penalize.

39.6 JSON Settings

Fields in titan_settings.json:

{
  "ta_gates": {
    "rsi_gate": "Off",
    "ema_alignment_gate": "Off",
    "adx_gate": "Off",
    "bb_squeeze_gate": "Off",
    "macd_gate": "Off",
    "stoch_rsi_gate": "Off"
  },
  "ta_gate_soft_penalty": 15.0
}

Possible values per gate: "Off", "Soft", "Hard".

39.7 Visual Pipeline

Oracle decide Buy/Short
    โ†“
TA Gates (RSI โ†’ EMA โ†’ ADX โ†’ BB โ†’ MACD โ†’ StochRSI)
    โ†“ Hard gate failed?  โ†’ return None (BLOCAT)
    โ†“ Soft gates failed?  โ†’ score -= penalty * nr_failed
    โ†“
Classical Bonus (daca activ)
    โ†“
Return TradeDecision cu scorul final

40. INDICATOR CACHE โ€” HYBRID STREAMING + ORACLE WITH CACHE PER SYMBOL

40.1 What is

IndicatorCache eliminates repeated recalculation of technical indicators in autopilot. Instead of recalculating all indicators (EMA, RSI, MACD, BB, ADX, VWAP, StochRSI, Oracle) from scratch on 200 candles every cycle, the cache stores the result and returns it instantly when the candle has not changed.

40.2 How it works

The autopilot evaluates each candidate symbol at each cycle (~1 second). Between candles (eg: at TF 5m, 300 cycles per candle), the indicators do not change. The cache exploits this property:

SituationWhat does the cache doLatency
Same candle (95%+ of cycles)Returns stored result~0
New candleStreamingIndicators O(1) + Oracle batch< 5ms
First time per symbolFull batch calculation10-50ms

40.3 Hybrid strategy

The two results are combined in one complete Indicators snapshot.

40.4 Eviction

The cache automatically deletes entries not accessed for more than 1 hour. This prevents memory growth for symbols that have been evaluated only once and are no longer active.

Eviction runs at ~1% of autopilot cycles (probabilistic check, not dedicated timer).

40.5 Guarantee of correctness

At cold start (first call per symbol), the cache runs calculate_all_with_periods() completely โ€” exactly the same function as the path without cache. This guarantees that the result is BIT-IDENTICAL. After the cold start, the incremental updates were validated with proptest at 1e-10 accuracy.

40.6 What is NOT cached

40.7 Updated Pipeline

Autopilot ciclu
    โ†“
get_candles(simbol, TF)  โ† Ring Buffer sau REST fallback
    โ†“
IndicatorCache.get_or_compute(simbol, TF, candles)
    โ”œโ”€ Cache hit?  โ†’ return instant (zero calcul)
    โ”œโ”€ Candle nou? โ†’ StreamingIndicators.update() + Oracle batch โ†’ merge โ†’ store
    โ””โ”€ Cold start? โ†’ batch complet โ†’ store
    โ†“
check_entry(simbol, candles, indicators)
    โ†“
TA Gates (RSI โ†’ EMA โ†’ ADX โ†’ BB โ†’ MACD โ†’ StochRSI)
    โ†“
Trade Decision

41. AUDIO/VISUAL ALERTS โ€” TITAN AUDIO SYSTEM

41.1 What is

TitanAudio adds sound and visual alerts on critical trading events. Sounds are generated procedurally with the Web Audio API (no external audio files). The goal: not to miss fills, breakers or flash crashes when you are not actively looking at the screen.

AUDIO ON/OFF button

In the TITAN SAFETY panel header, next to the circuit breaker badge, there is the AUDIO: ON / AUDIO: OFF button.

41.2 Monitored events

EventSoundEffects visuals
Trade fill (buy/sell)Blip ascending 3 tones (520โ†’780โ†’1040 Hz)Flash title: "FILL: SIDE SYMBOL" (2.5s)
Breaker CAUTIONPulsating alarm 3x (600+750 Hz)Flash title + yellow screen glow
Breaker HALT/PANICPulsating alarm 3x (600+750 Hz)Flash title + red screen glow
Flash crash detectedAggressive descending buzz (440โ†’330โ†’220 Hz)Flash title + screen glow magenta
Watchdog dead loopsTriple triangle ping (400โ†’500โ†’400 Hz)Flash title: "WATCHDOG: N DEAD"
Breaker NORMAL (reset)โ€” (no sound)โ€”

41.3 Screen glow

Semi-transparent fullscreen overlay with animated border glow (3 pulses). It deactivates automatically after 2-5 seconds. Colors indicate severity:

41.4 Flash title

Alternating document.title with the alert message at 500ms. Useful when the Titan window is minimized or on another monitor โ€” the title flashes in the taskbar.

41.5 Technical notes



42. CONCURRENT AUTOPILOT ARCHITECTURE (S5+S6)

42.1 What it is

Autopilot uses futures::future::join_all to evaluate positions and candidates in parallel. Decisions (close_position, send_order, state mutations) are applied sequentially after gather.

42.2 Flow on a tick

  1. Parallel Exit Gather โ€” for each open position, evaluate_position_exit() is run concurrently: get_candles, calculate_atr, signal markers, adaptive stops, force exit checks. Returns ExitEvaluation (read-only struct, zero side effects).
  1. Sequential Exit Apply โ€” iterate Vec<ExitEvaluation>:
  1. Sequential Pre-filter โ€” for each candidate: flash crash check, holding check, pending orders (API call), cooldown, position limit, correlation guard
  1. Parallel Entry Gather (non-SignalStrategy) โ€” evaluate_candidate_entry() competitor: get_candles, indicator_cache.get_or_compute, check_entry. Returns EntryEvaluation.
  1. Best-Score Selection โ€” from all evaluations with Signal::Buy or Signal::Short, the candidate with the highest score is selected. OFI + Nexus filters applied to the selected candidate. Then send_order.

42.3 Best-Score vs First-Match

Previously, the autopilot executed the first candidate that passed the filters (the order was arbitrary from the list). Now, all the candidates are evaluated, and the one with the highest score is chosen. Advantage: higher quality entries when there are several candidates at the same time.

42.4 Locking Safety

All locks in parallel code are short-lived reads (<1us):

Mutations and API calls remain on the main task: trail_highs/lows, session_analytics, close_position, send_order_internal.

42.5 When it helps the most


43. PORTFOLIO RISK GATES โ€” VaR + HHI Concentration (S9)

43.1 What are

Two complementary gates at portfolio level that block entries when the total risk is too high. It is applied AFTER OFI and Nexus filters, BEFORE position sizing.

43.2 Location in UI

PORTFOLIO RISK GATES card (purple, #E040FB) in the HFT Engine tab, after TA Entry Gates. Two sub-panels: VaR (left) and HHI (right).

43.3 Parameters

ParameterElement IDSettings BackendDefaultrank
VaR Gate togglehft-var-gateenable_var_gateOFFbool
Max Portfolio VaR %hft-var-maxmax_portfolio_var_pct2.00.1-10.0
Lookback Periodshft-var-lookbackvar_lookback_periods205-100
Concentration Gate togglehft-hhi-gateenable_concentration_gateOFFbool
Max HHIhft-hhi-maxmax_concentration_hhi0.400.10-1.00

The VaR % slider has div=10 (slider 1-100, display 0.1-10.0%). The HHI slider has div=100 (slider 10-100, display 0.10-1.00).

43.4 How VaR Gate works

  1. Extract close prices from CandleRingBuffer per symbol in the portfolio
  2. Compute log returns: r_t = ln(close_t / close_{t-1}) over the last var_lookback_periods periods
  3. Constructs the NxN covariance matrix (sample covariance, N-1 denominator)
  4. Calculate parametric VaR: VaR = z_score(0.99) * sqrt(w' * Sigma * w) where w = position weights
  5. If the proposed VaR (with the new position included) > max_portfolio_var_pct โ†’ entry BLOCKED

z_score(0.99) = 2.326 โ€” we use 99% confidence (not 95%) for more aggressive protection in scalping.

CVaR (Expected Shortfall) is calculated internally but not used as gate โ€” available for future analysis.

43.5 How HHI Gate works

HHI = sum(w_i^2)     unde w_i = |notional_i| / total_notional

If adding the proposed position would take HHI over max_concentration_hhi, the entry is blocked.

43.6 Pipeline position

check_entry() โ†’ Signal Buy/Short + scor
  โ†’ TA Gates (Soft/Hard penalties)
    โ†’ OFI Filter (flow direction)
      โ†’ Nexus Consensus (multi-agent)
        โ†’ HHI Gate (concentrare) โ† S9
          โ†’ VaR Gate (risc statistic) โ† S9
            โ†’ Position Sizing
              โ†’ send_order_internal()

HHI is evaluated before VaR because it is O(1) (pure arithmetic), while VaR requires the construction of the covariance matrix.

43.7 Recommendations for use

43.8 Difference with Circuit Breaker

appearanceCircuit Breaker (ยง18)VaR/HHI Gate (ยง43)
When it actsAFTER lossBEFORE entry
What measureDaily PnL, drawdownVolatility, correlation, concentration
LevelTotal portfolio (PnL)Proposed per-entry
ActionReduce positions / stop tradingBlocks the specific entry
ResetManualAutomatic (conditions change)

43.9 Technical implementation

Backend: titan-risk crate โ€” compute_returns(), covariance_matrix(), parametric_var(), conditional_var(), var_gate_blocks_entry(), concentration_hhi(), hhi_gate_blocks_entry()

Integration: src-tauri/src/loops/autopilot.rs โ€” block of ~45 lines after OFI+Nexus checks

Frontend: src/index.html (HTML card) + src/titan_perf_stats.js (event handlers + restore + batch save)


44. FEATURE STORE โ€” ENTRY CONTEXT SNAPSHOT (S13)

44.1 What is

Feature Store captures the complete context of indicators and strategy at the time of entering a trade. The snapshot (20 fields) is temporarily stored in memory and attached to TradeRecord when the trade is closed (full or partial exit).

44.2 Why it matters

Without the Feature Store, the log only contains PnL and timestamp. With Feature Store, each trade responds to:

44.3 TradeFeatures fields

Oracle: oracle_score, oracle_confidence, oracle_regime

Indicators: rsi, adx, atr_pct, ema9, ema50, vpin, hurst, rvol

Microstructure: ofi, spread_bps, imbalance_ratio

Strategy: strategy_score, signal_source, fvg_type, entry_type, ta_gates_passed, ta_gates_total

44.4 Technical flow

  1. Entry successful โ†’ snapshot_entry_features() reads from IndicatorCache (peek()) + OfiState (ArcSwap.load()) + TradeDecision โ†’ stores in state.entry_features HashMap
  2. Full exit โ†’ entry_features.remove(symbol) โ†’ passes to TradeRecordInput โ†’ journal on disk
  3. Partial exit โ†’ entry_features.get(symbol).cloned() (DO NOT delete) โ†’ journal on disk

44.5 Backward compatibility

#[serde(default)] on field entry_features: Option<TradeFeatures>. Old journals are loaded with None. Zero breaking changes.

44.6 Component peek() on IndicatorCache

Read-only method that returns a clone of the cached snapshot without triggering re-computation or updating the access time. Used exclusively by the Feature Store.

44.7 Impact on performance

Zero measurable overhead:


45. MICROSTRUCTURE SCORE MODIFIER โ€” STREAM VPIN + SPREAD REGIME + DUAL VPIN DIVERGENCE (S10-lite)

45.1 What it does

Applies soft score modifiers to entries based on microstructure signals in real time. Inserted in evaluate_candidate_entry() after check_entry() and before the ranking of the candidates.

45.2 Stream VPIN

VPIN calculated from trade-by-trade flow (Lee-Ready classification), not from candle BVC:

45.3 Spread Regime

Dual EMA on spread_bps with narrowing detection:

45.4 Dual VPIN Divergence

Compare stream VPIN (tape) vs candle VPIN (oracle). Divergence = information:

DivergenceInterpretationScore
> +0.15Hidden toxicity (tape sees what the candles don't show)-8
< -0.15Filtered false alarm (candle VPIN is noise)+5
[-0.15, +0.15]Concordance0

45.5 Complete table score modifiers

ConditionScoreCumulative
Spread narrowing+5Yes
NBBO imbalance aligned (Sawmill> 0.3)+4Yes
Dual VPIN false alarm (div < -0.15)+5Yes
Dual VPIN hidden toxicity (div > +0.15)-8Yes
Extreme VPIN Stream (> 0.85)-10Yes

Possible Range: +14 (all bonuses) to -18 (all penalties)

45.6 Position in the pipeline

check_entry() -> TradeDecision (score base)
        |
apply_microstructure_modifier() -> score ajustat
        |
best candidate selected (max score)
        |
OFI filter / Nexus filter (binary)
        |
VaR / HHI gates (binary)
        |
position sizing + send_order

Microstructure modifier is applied AFTER scoring but BEFORE ranking. It affects which candidate is selected, not only if he enters.

45.7 Extended TradeFeatures

Two new fields on TradeFeatures (backward compatible with #[serde(default)]):

The existing vpin field now contains stream_vpin (more precisely than candle VPIN).

45.8 OfiState new fields

4 fields added to OfiState (l2_heatmap.rs):

All with Default = 0/false. ArcSwap lock-free, zero contention added.

45.9 Extended event frontend

ofi-update event now includes stream_vpin and spread_narrowing for UI display.

45.10 Impact on performance

Zero measurable overhead:



46. โ€‹โ€‹SCORE MODIFIERS + CLASSICAL BONUSES + ENTRY THRESHOLD MATRIX (N4)

46.1 What it does

It exposes ~50 numerical values โ€‹โ€‹(previously hardcoded in strategy.rs) as configurable parameters in the UI. Organized in 3 new cards between STRATEGY SCORING and ENGINE STOPS.

46.2 Card: SCORE MODIFIERS (orange header)

21 sliders that directly control how calculate_score() and check_ta_gates() calculate the entry score:

SliderBackend FieldDefaultEffect
Chaos Kill Penaltysm_chaos_kill_penalty-50Penalty when confidence < chaos threshold
Chaos Kill Fallbacksm_chaos_kill_fallback50Score returned when oracle is missing
Chaos Conf x MeanRevsm_chaos_conf_mult_mean_rev1.5Chaos threshold multiplier on MeanRev
Chaos Conf x Chaoticsm_chaos_conf_mult_chaotic2.5Multiplier on Chaotic
Chaos Conf x Unknownsm_chaos_conf_mult_unknown1.5Multiplier on Unknown
Regime x MeanRevsm_regime_mult_mean_rev0.82Oracle contribution weight on MeanRev
Regime x Chaoticsm_regime_mult_chaotic0.55Weight on Chaotic
Regime x Unknownsm_regime_mult_unknown0.73Weight on Unknown
VPIN Penalty Highsm_vpin_penalty_high-20When VPIN > scalping gates
VPIN Penalty Medsm_vpin_penalty_medium-10When VPIN > normally gate
FVG Bull Bonussm_fvg_bullish_bonus+15Bullish FVG detected
FVG Bear Penaltysm_fvg_bearish_penalty-15Bearish FVG detected
RVOL Tier1 Thr.sm_rvol_tier1_threshold2.0Tier 1 volume threshold
RVOL Tier1 Bonussm_rvol_tier1_bonus+8Bonus RVOL > 2x
RVOL Tier2 Thr.sm_rvol_tier2_threshold4.0Tier 2 volume threshold
RVOL Tier2 Bonussm_rvol_tier2_bonus+12Bonus RVOL > 4x
StochRSI OBsm_stoch_rsi_overbought80Overbought threshold
StochRSI OSsm_stoch_rsi_oversold20Oversold threshold
BB Squeeze Widthsm_bb_squeeze_width0.02Squeeze detection threshold
Strong Labelsm_entry_label_strong80Score > threshold = "STRONG"
Mild Labelsm_entry_label_mild60Score > threshold = normal entry

46.3 Card: CLASSICAL BONUSES (green header)

6 sliders that control the bonuses in compute_classical_confirmation(). The card appears semi-transparent (opacity 0.5) when Classical Filters is OFF.

SliderBackend FieldDefaultEffect
RSI Bonuscb_rsi_bonus10.0RSI confirmation bonus
EMA Align Bonuscb_ema_alignment_bonus15.0Bonus EMA20/50 alignment
ADX Bonuscb_adx_bonus10.0Bonus trend strength
BB Squeeze Bonuscb_bb_squeeze_bonus5.0Bonus Bollinger squeeze
VWAP Bonuscb_vwap_bonus10.0Bonus price vs VWAP
Headcb_cap50.0Maximum bonus limit

46.4 Card: ENTRY THRESHOLD MATRIX (header cyan)

Grid 7 regimes x 3 values โ€‹โ€‹(Long, Short, Confidence) with direct numerical inputs. The Scalping/Normal dropdown switches between the two sets.

Regimes: Trending, Trending Aggro, MeanRev, MeanRev Aggro, Chaotic, Unknown, Unknown Aggro.

Interpretation:

Chaotic Regime does not have the Aggro variant (it is already maximally restrictive).

46.5 VALIDATE button

Call invoke('validate_thresholds') and check:

Warnings displayed as toasts (does not block the save).

46.6 RESET DEFAULTS button

Restores all values โ€‹โ€‹to defaults for the currently selected mode (Scalp or Normal). Save automatically on the backend.

46.7 Persistence

All values โ€‹โ€‹are saved in AppSettings / titan_settings.json. Entry thresholds as HashMap<String, EntryThreshold>, score modifiers and classical bonuses as structs with #[serde(default)]. Old settings are loaded correctly (defaults inserted automatically).

46.8 Relationship with other sections


47. ORACLE WEIGHT ADAPTATION (S15)

47.1 Toggle

PropertyValue
Settingsenable_oracle_adaptation
DefaultOFF
What doesEnables the auto-tuning of Oracle weights based on the PnL of the trades

When it is OFF, the weights from ยง21 are used directly (identical behavior to the previous one). When it is ON, the weights are automatically adapted per regime.

47.2 How adaptation works

The Oracle has 5 directional weights (ยง21.1): Kalman, Entropy, Hurst, VPIN, Wavelet. With active adaptation:

  1. At each trade entry, the 5 directional signals of the Oracle and the market regime are captured
  2. At each output, the signals are correlated with the PnL direction (profit = +1, loss = -1)
  3. Every 50 trades, the weights are recalculated proportionally to the absolute correlation per layer

47.3 Per-Regime Adaptation

The adaptation maintains 4 separate sets of weights, one per MarketRegime:

RegimeDescriptionTypical dominant weight
TrendingDirectional marketKalman (directional predictor)
MeanRevertingOscillating marketHurst (persistence signal)
ChaoticThe messy marketThe weights tend to be uniform (no layer is reliable)
UnknownIndeterminate regimeThe weights remain close to the bases

At entry, the weights adapted for the CURRENT regime of the market (from the last cached cycle) are used.

47.4 Confidence-Weighted Learning

The learning rate (alpha) varies with the confidence of Oracle at entry:

ConfidenceEffectively AlphaEffect
0.950.095It contributes maximally to learning
0.500.050Contributes medium
0.100.010Contribute minimally (filtered)

Trades where Oracle was unreliable do not pollute the adaptation.

47.5 Safety: Caps and Decay

MechanismValueEffect
Lower head0.5x baseA weight does not fall below half of the slider
Upper head2.0x baseA weight does not increase more than twice compared to the slider
Normalizationsum = 1.0After each recalculation, the sum = 1.0
Continuous decay0.997/tradeHalf-life ~230 trades, prevents overfitting

47.6 Interaction with the Oracle Fusion slider (ยง21)

The slider sets the basic weights. Adaptation changes them relatively:

47.7 Persistence

The adaptation data (correlations, adapted weights, trade count) are saved in titan_state_snapshot.json. On restart, it is restored automatically. In-flight signals (trades open at restart) do not contribute to adaptation.

47.8 Relationship with other sections


48. EXIT INFLIGHT GUARD (S39-S40)

48.1 What is

Per-symbol deduplication guard on the exit path of the autopilot that prevents repeated sending of sell orders for the same position. Solve a critical "runaway exit loop" bug; โ€” when the broker does not yet reflect the closing of the position, the autopilot sent duplicate SELL orders every tick (~2-3 seconds), each one either opening an accidental short position or generating 429 Too Many Requests errors.

Strengthened in S40 with strict guard (no TTL), checking broker open-orders, PendingClose lifecycle, and suppression of synthetic positions.

48.2 How it works

Camp on TitanState:

pub exit_inflight: Mutex<HashMap<String, u64>>

Two layers of protection:

LayerMomentAction
1. Strict inflightevaluate_position_exit() on every tickIf exit_inflight.contains_key(symbol) โ†’ return None (complete skip, no TTL)
2. Broker open-orderForward by close_position()has_pending_orders_for_symbol() asks the broker (GET /v2/orders?status=open). If there is an open order โ†’ skip
SETclose_position() calledSet exit_inflight[symbol] = timestamp_ms before sending the order

The guard remains active until the broker confirms that the position is flat (through reconciliation) or a permanent error removes the entry. There is no timeout โ€” the source of truth is the broker.

48.3 Where to clean

The guard is cleaned (remove from HashMap) in 2 locations:

  1. Position reconciliation โ€” every 15s, exit_inflight.retain keeps only symbols still present in the broker's raw positions (before grace/blacklist filtering). When the broker no longer reports the symbol, the entry disappears automatically.
  2. Autopilot permanent failure โ€” for errors 422, "invalid", "does not exist", "not found" โ€” wipe to avoid permanent blockage.

Do not clean in:

48.4 Relationship with other sections

48.5 PendingClose on Exit Success

On close_position success, the autopilot marks the PendingClose position with closed_at set, instead of deleting it from settings.positions. This prevents two problems:

  1. False synthetic position โ€” without PendingClose, when the fill reaches the WebSocket, trade_updates did not find the position and created a new Sell type (false short position)
  2. Re-insertion by recon โ€” reconciliation could re-insert the position as Open after the grace period, ignoring the fact that the autopilot closed

The state PendingClose is preserved by the merge in position_recon (line new_pos.state = existing.state.clone()). The position disappears naturally when the broker no longer reports it.

48.6 Synthetic Position Suppression

When a fill arrives on the WebSocket for a symbol that does NOT exist in settings.positions, trade_updates checks exit_inflight:

This logic prevents the appearance of a Sell-type phantom position when the closing fill arrives after the autopilot marked the PendingClose position or after it was deleted by recon.

48.7 ORDER ACCEPTED โ€” Correct Log

send_order_internal now issues ORDER ACCEPTED (not ORDER FILLED) on the HTTP 200 response. HTTP 200 means that the broker accepted the order, not that it was executed. Actual fills appear as FILL: SELL LAR x212.0000 @ $X.XX [fill] (emitted by trade_updates on WebSocket).


49. Safety Gates โ€” VaR Fail-Closed, Asset Check, Intraday Blackout (S04.1)

Panel โฌก SAFETY GATES in the HFT Engine tab, under Portfolio Risk Gates.

49.1 Parameters

ParameterElement IDSettings BackendDefaultrank
VaR Fail-Closedsg-var-fail-closedvar_fail_closedMRbool
Asset Check Hard Gatesg-asset-check-hardasset_check_hard_gateMRbool
Blackout First (min)sg-blackout-firstblackout_first_mins50-60
Blackout Last (min)sg-blackout-lastblackout_last_mins50-60
Blackout Exempt Symbolssg-blackout-exemptblackout_exempt_symbolsemptycomma-sep
Min Dollar Volumesg-min-dvolscan_min_dollar_volume$5M0-$100M

49.2 VaR Fail-Closed

When activated (default), if there is not enough return data (no symbol with >= 2 periods), var_gate_blocks_entry() returns true (blocks entry). It prevents entries in conditions of risk uncertainty. When disabled, lack of data allows entry (legacy fail-open behavior).

49.3 Asset Check Hard Gate

When activated (default), if the HTTP request to /v2/assets/{symbol} fails (timeout, network error), the order is rejected with an error. When disabled, the HTTP failure generates only a warning and the command continues (soft fail).

49.4 Intraday Blackout

It prevents new entries in the first blackout_first_mins minutes (after 9:30 ET) and the last blackout_last_mins minutes (before 4:00 PM ET) of the session. It does not affect the exits. DST-aware via is_us_dst().

Blackout Exempt Symbols: Comma-separated list of symbols (ex: SPY, QQQ) that bypass the blackout. Case-insensitive.

49.5 Blackout Status Badge

Neon-orange badge with animation glow-breathe displayed in 2 locations:

Displays the countdown of the remaining minutes. It hides automatically when the blackout is not active. Refresh: 15 seconds, calculated client-side.

49.6 VaR Gate Event + Toast

When VaR gate blocks an entry, it emits event Tauri var-gate-blocked with:

{ "symbol": "AAPL", "reason": "portfolio VaR would exceed threshold", "max_var_pct": 2.0, "fail_closed": true }

Frontend: TitanToast.show() warning type with symbol and motif (4s display).

49.7 Settings Validation

validate_safety_settings() check:

Warnings are logged and included in the batch_update_settings response.

49.8 Gate Chain Complete (Updated)

Entry Signal (Oracle/GPU/Signal)
  โ†’ Score Modifiers (N4)
    โ†’ TA Gates (Soft/Hard penalties)
      โ†’ BLACKOUT Gate (first/last mins, exempt symbols) โ† S04.1
        โ†’ OFI Filter (flow direction)
          โ†’ Nexus Consensus (multi-agent)
            โ†’ HHI Gate (concentrare) โ† S9
              โ†’ VaR Gate (risc statistic, fail-closed) โ† S9+S04.1
                โ†’ Position Sizing
                  โ†’ Asset Check (hard gate) โ† S04.1
                    โ†’ send_order_internal()

50. State Health Dots โ€” Sub-State Decomposition Monitor (S04.5)

In the STATUS sidebar, 4 cyber-HUD mini-dots show the health of the sub-states in real time:

AssocSub-statesMonitored fields
TRDTradingState10 Mutex (trail, entry metadata, exit, blacklist)
MKTMarketDataState5 Mutex (prices, candles, indicators, vol, bars)
RSKRiskState3 Mutex (analytics, drawdown, flash crash)
SCNScanState5 Mutex (best-TF, results, progress, prefilter, cancel)

Colors:

Hover: Tooltip with details (locks free / contended, session generation).

Backend: Tauri command get_state_health -- try_lock sampling on all 23 Mutexes. Poll every 10 seconds.


51. SMARTTREND GENETIC OPTIMIZER (S13)

SmartTrend has a dedicated genetic optimizer (StGeneticOptimizer), completely independent of the classic Fusion optimizer. When StrategyMode::SmartTrend is active, genetic_evolution_loop automatically switches to SmartTrend evolution.

Evolving Parameters (12)

ParameterMinMAXWhat controls
macro_weight0.050.60MACRO pillar share
micro_weight0.050.60MICRO pillar share
momentum_weight0.050.60The share of the MOMENTUM pillar
entry_threshold0.500.95Minimum score for ENTRY
stalking_threshold0.300.80Minimum score for STALKING
changepoint_reset1.010.0% volatility for FSM reset
trail_tighten_pct0.100.80How tight the trail stop becomes
hysteresis_margin0.010.20Dead zones between FSM states
bayesian_halflife330Bayesian half-life tracker
stabilization_window550Stabilization window after regime shift
dominant_cycle_filter550Dominant cycle filter
risk_per_trade0.0020.030Risk per trade (fraction)

The weights (macro/micro/momentum) are auto-normalized to sum = 1.0 after mutation/crossover.

Walk-Forward Backtest SmartTrend

Run the real FSM (Flat โ†’ Stalking โ†’ Entry โ†’ InTrade โ†’ Trail) on historical data with IS/OOS split 70/30. Calculate PnL, Sharpe, Profit Factor, Max Drawdown, Win Rate, Trade Count, Avg Bars In Trade.

Fitness Formula

fitness = sharpe * min(PF, 5.0) + trade_count_bonus + win_rate_bonus + stability_bonus - dd_penalty

UI Components

ElementsLocationWhat does it look like?
Convergence ChartEVOLUTION panel canvasIS fitness (cyan) + OOS fitness (gold dashed) by generations, green dots at champion promotion, diversity bar
PARAMS buttonEVOLUTION panel headerModal drill-down with all 12 params, delta% vs defaults, heat-color bars
DIV badgeEVOLUTION panel headerDiversity % population. Red+pulses < 15%, cyan 15-40%, verde > 40%
Comparison Paneltab-13 SmartTrend CFGRUN COMPARISON: run Fusion + SmartTrend on the same candle, grid with winner highlight

Taurus orders

Commandreturns
get_st_evolution_statsGender, IS/OOS fitness, sharpe, diversity, champion params
get_st_fitness_historyVec<{gen, is_fitness, oos_fitness, diversity, promoted}>
get_st_champion_paramsParams with value, default, delta%, min, max
run_comparison_backtest_cmdComparisonResult: {fusion: BacktestResult, smarttrend: StBacktestResult, verdict}
freeze_st_evolutionIt stops the evolution of SmartTrend
resume_st_evolutionSmartTrend evolution starts


52. EXECUTION RESILIENCE (S14, Session 63)

Order Lifecycle

Pending Order Watchdog

Health Observability

EventosTriggerBadge UI
equity-sync-degradedConsecutive equity sync errorsEQUITY STALE (gold+pulse)
equity-sync-criticalCritical errors equity syncEQUITY STALE (gold+pulse)
trade-updates-healthWS connect/disconnectWS DISCONN (red+pulses)

Cockpit Strip

Persistent bar under the main header with: EQUITY, P&L, POS count, MODE (auto/manual), BREAKER status, GEN (generation id), health badges. Poll 5s + event-driven badges. New badges (S71): TMR:N (active timers), MRK:S/F/T (chart markers per source), HP:N% (real health with latency + fill rate).

Bounded Channels

mpsc::channel(256) replaces unbounded_channel on the streamer. try_send with overflow warning.

HHI Notional Fixed

qty * live_price instead of qty * entry_price. Structured log: hhi_pre, hhi_post, blocked.

Exit Features

exit_features: Option<TradeFeatures> on TradeRecord โ€” snapshot market conditions at close trade.

UI Bonuses

FeaturesDescription
Live Fill MarkersBUY/SELL triangles on the chart, persistent, 3s refresh
Journal Min P&LInput filter in journal bar
Time-in-TradeTIME column by positions (dim/cyan/gold/orange)

ยง53: S16 UX Polish โ€” HFT-Relevant Changes

Fill Quality Columns: 3 new columns in HFT Targets table โ€” SLIP (avg slippage bps, color-coded), T2F (avg time-to-fill), TRADES (count per symbol). Backend get_fill_quality_stats. Polling 30s.

Unified Chart Markers: _titanMarkerEngine goes fills+signals+SmartTrend, debounce 100ms, cap 50 fills, pruning 24h. Public API: update(source, markers), clear(source), stats(), getSource(name). Overlay on chart: SIG:N FILL:N ST:N TOT:N.

Latency Histogram Rolling: Ring buffer 300 samples (5 min window) instead of cumulative.

Health Score Badge: HP:XX% in the cockpit โ€” 6 composite sub-scores. Polling 10s.

Cockpit Strip V2: GEN sync real, BREAKER initial poll, W/R badge, UPTIME badge.

Manual created: March 28, 2026 โ€” Session 19. Updated: April 3, 2026 โ€” Session 71 (cockpit strip badges TMR/MRK/HP, unified marker engine API, chart marker overlay). Full coverage: ~155+ configurable parameters, 28 smart features, 53 sections.