2.15

📋 Obchodní pravidla

Automatická obchodní pravidla a upozornění

1. Co jsou obchodní pravidla?

Obchodní pravidla jsou předdefinované podmínky, které vám pomáhají obchodovat disciplinovaně. Systém automaticky sleduje vaše pozice a zasílá upozornění, když je pravidlo splněno. Nikdy tak nezapomenete na důležité akce.

Systém obchodních pravidel:
• Automaticky připomíná důležitá pravidla
• Varuje při porušení limitů rizika
• Pomáhá s dokumentací a analýzou dodržování pravidel
• Podporuje různé styly obchodování (opce, akcie atd.)

2. Proč jsou pravidla důležitá?

Většina obchodníků má pravidla v hlavě, ale v horku chvíle na ně zapomíná. Příklad: „Uzavřít při 50% zisku" – ale pak doufáte ve větší zisk a zmešká vás výstup. Obchodní pravidla vám automaticky připomenou!

„Plan your trade, trade your plan" – Se systémem pravidel se tato zásada stává realitou.

Architektura: Dvě dimenze

Systém pravidel je založen na dvou základních dimenzích:

ZDROJ a ROZSAH (Oblast platnosti)

4. Dimenze 1: Zdroj pravidla

🔧 Systémové předvolby
Předdefinovaná pravidla systému, která lze aktivovat jedním kliknutím. Jsou založena na osvědčených obchodních postupech.

Příklady:
• „50% Take Profit" – Uzavřít při 50 % max. zisku
• „21 DTE Management" – Varovat při 21 dnech do splatnosti
• „200% Stop-Loss" – Uzavřít při 2× ztrátě prémie

✏️ Uživatelsky definované (Custom)
Vlastní pravidla, která sami vytvoříte a která přesně odpovídají vašemu stylu obchodování.

5. Dimenze 2: Oblast platnosti (Scope)

Každé pravidlo má oblast platnosti, která určuje, pro které pozice platí:
🎯 Pozice – Individuální obchodní plán
🏦 Účet – Konzervativní IRA účet
💼 Portfolio – Obecné pravidlo rizika

6. 🎯 Pravidla pozic podrobně

Pravidla pozic platí pro konkrétní pozici. Umožňují definovat individuální plán pro každý obchod.

Typická pravidla pozic:
• Stop-loss cena
• Take-profit cíl
• DTE-based – Uzavřít při 14 DTE
• ITM varování
• Individuální obchodní plán

7. 🏦 Pravidla účtu podrobně

Pravidla účtu platí pro jeden brokerský účet. Pomáhají vést různé strategie na různých účtech.

Typická pravidla účtu:
• Max. využití kupní síly %
• Max. počet otevřených pozic
• Povolené třídy aktiv
• Max. velikost pozice na účtu

8. 💼 Pravidla portfolia podrobně

Pravidla portfolia platí napříč všemi účty. Chrání váš celkový majetek.

Typická pravidla portfolia:
• Celkový limit expozice
• Sektorová diverzifikace
• Max. velikost pozice celkem
• Celková pravidla rizika

9. Kategorie pravidel

Pravidla jsou rozdělena do kategorií podle toho, kdy se uplatní:

📥 Vstupní pravidla – Před otevřením pozice
📤 Výstupní/správcovská pravidla – Kdy uzavřít nebo upravit pozice
⚠️ Riziková pravidla – Limity na úrovni portfolia
🧠 Psychologická pravidla – Ochrana před emocionálním obchodováním

10. Systémová architektura: Engine pravidel

Engine pravidel je jádrem systému. Nepřetržitě sleduje všechny vaše pozice a kontroluje, zda jsou splněna pravidla. Spouští příslušnou akci, pokud je podmínka splněna.

11. Integrace do platformy

Obchodní pravidla jsou integrována na různých místech platformy:
Dashboard – Widget „Vyžaduje akci" s aktivními upozorněními
Detail pozice – Aktivní pravidla pro danou pozici
Vstup do obchodu – Kontrola před otevřením (riziková pravidla)
Watchlist – Sloupec signálů na základě vstupních pravidel
Notifikace – Push/e-mail při spuštění pravidla

12. Typy podmínek

Pro pravidla jsou k dispozici tyto typy podmínek:
PROFIT_PCT – Zisk v %
LOSS_PCT – Ztráta v %
DTE – Days to Expiration
DELTA – Hodnota delta
IV_RANK – IV Rank/Percentile
POSITION_SIZE_PCT – Pozice > X % portfolia
BUYING_POWER_PCT – Využití BP > X %
EARNINGS_DTE – Earnings za X dní

13. Stav: Koncept

⚠️ Poznámka: Systém obchodních pravidel se momentálně nachází ve fázi konceptu. Zde popsané funkce budou implementovány v budoucích verzích.

Vaše zpětná vazba je vítána pro optimální nastavení funkcí!

14. UI Preview: Create a Custom Rule

Here is how to create your own individual rule:

┌─────────────────────────────────────────────────────────┐
│ ➕ New Rule                                              │
├─────────────────────────────────────────────────────────┤
│                                                         │
│ Name: [My Stop-Loss Rule____________________]           │
│                                                         │
│ Scope:                                                  │
│ ○ 💼 Portfolio (all accounts)                          │
│ ● 🏦 Account: [Interactive Brokers ▼]                  │
│ ○ 🎯 Position: [Select position...]                    │
│                                                         │
│ When:                                                   │
│ [Loss %_____▼] [>=] [15__] [%]                         │
│                                                         │
│ Then:                                                   │
│ [🔔 Send Alert___▼]                                    │
│                                                         │
│ Asset Type: ○ All  ● Stocks  ○ Options                 │
│                                                         │
│              [Cancel]  [💾 Save]                       │
└─────────────────────────────────────────────────────────┘

You define: Name, Scope, Condition (When…), Action (Then…) and Asset Type.

15. UI Preview: Dashboard Widget "Action Required"

On the dashboard you see all positions where a rule has been triggered:

┌─────────────────────────────────────────────────────────┐
│ ⚠️ Action Required (3)                                  │
├─────────────────────────────────────────────────────────┤
│                                                         │
│ 🟡 AAPL 180 PUT         50% profit reached (52%)       │
│    Rule: 50% Profit Take                                │
│    [Close] [Ignore]                                     │
│                                                         │
│ 🔴 MSFT 400 CALL        21 DTE reached (18 days)       │
│    Rule: 21 DTE Management                              │
│    [Roll] [Close] [Ignore]                              │
│                                                         │
│ 🟡 TSLA Stock           Stop-loss nearly reached (-9%) │
│    Rule: 10% Stop-Loss                                  │
│    [Sell] [Adjust Stop] [Ignore]                        │
│                                                         │
└─────────────────────────────────────────────────────────┘

Each alert shows: Symbol, rule name, current value, and action buttons. The color (🟡 yellow, 🔴 red) indicates urgency.

16. UI Preview: Position Detail with Rules

In the detail view of a position you see which rules are active:

┌─────────────────────────────────────────────────────────┐
│ AAPL 180 PUT 2025-01-17                                 │
├─────────────────────────────────────────────────────────┤
│ ...Position Details...                                  │
│                                                         │
│ 📋 RULES FOR THIS POSITION                             │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ ✅ Portfolio: 50% Profit Take (active)             │ │
│ │ ✅ Portfolio: 21 DTE Management (active)           │ │
│ │ ➕ Add rule for this position...                    │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘

You see all rules that apply to this position (portfolio-wide, account-wide, or position-specific). With ➕ you can directly create a new rule for this position.

17. Condition Types

The following condition types are available for rules:

TypeDescriptionAsset
PROFIT_PCTProfit in %All
LOSS_PCTLoss in %All
DTEDays to ExpirationOptions
DELTADelta valueOptions
IV_RANKIV Rank/PercentileOptions
POSITION_SIZE_PCTPosition > X% of portfolioRisk
BUYING_POWER_PCTBP Usage > X%Risk
EARNINGS_DTEEarnings in X daysAll

18. Data Architecture (Simplified)

For the technically curious: the system stores rules in three tables:

1. trading_rule_presets (System Presets)
Admin-defined rules that all users can enable.

2. user_trading_rules (User Rules)
Contains activated presets and custom rules for each user, with scope assignment.

3. trading_rule_triggers (Trigger Log)
Logs when which rule was triggered and how the user responded (closed, ignored, etc.).

This structure enables:
• Fast checking of all active rules
• Analysis of rule compliance over time
• Compliance reporting in the trade journal

19. Wheel Strategy Rules

For the popular Wheel Strategy there are special rules:

RuleDescription
Only Stocks You Want to OwnOnly run the Wheel on stocks you would hold long-term
Cash-SecuredAlways keep enough cash for assignment
CC at ResistancePlace Covered Calls at technical resistance
CC Not Below Cost BasisNever sell Covered Calls below your purchase price

20. Implementation Phases

The Trading Rules system will be developed in phases:

Phase 1: Foundation
• Create database tables
• Define system presets
• Admin page for preset management

Phase 2: User Rules
• User rules UI
• Activation of system presets
• Create custom rules

Phase 3: Rule Engine
• Automatic checking of all rules
• Trigger detection
• Logging of all activations

Phase 4: Alerts & Notifications
• Dashboard widget "Action Required"
• Email notifications
• Push notifications (optional)

Phase 5: Integration
• Position detail: show active rules
• Trade entry: risk checks
• Trade journal: compliance analysis

21. Open Questions & Feedback

We want to design the system optimally and welcome your feedback on these questions:

1. Auto-Execution: Should rules also be able to execute trades automatically (e.g., auto-close)?

2. Check Interval: How often should the rule engine run (real-time vs. every 5 min vs. hourly)?

3. Community Rules: Should rules be shareable between users?

4. Which Presets: Which rules should be included as system presets?

Send your feedback to the support team or in the forum!

Status: Concept

⚠️ Note: The Trading Rules system is currently in concept phase. The features described here will be implemented in future versions.

Your feedback is welcome to help shape the features optimally! Detailed technical documentation can be found at docs/concepts/TRADING-RULES.md.

23. Trading Lights — Traffic Light System Before the Trade

Trading Lights is your market status dashboard in green/yellow/red. You'll find it on the dashboard and as a sidebar widget. It shows at a glance whether current market conditions are favorable for new trades.

What is displayed?
Three categories, each with its own traffic light (green/yellow/red):

Macro Environment — Fear & Greed Index, VIX, and NYSE Market Breadth as a third indicator (see next section).
Sector Context — your underlying's sector compared to the overall market (RSI, SMA200 status).
Underlying Status — the specific market you're looking at (trend, volatility, recent movements).

Majority logic instead of "worst indicator wins": Each category summarizes its indicators by majority — if 2 of 3 are green, the category is green. This prevents a single red outlier from negating an entire category.

Clicking on a traffic light opens a modal with beginner-friendly explanations for each indicator — what the value means, how it compares historically, and what actions are suggested.

24. NYSE Market Breadth — "How Many Stocks Are Actually Rising?"

Market breadth measures whether a market move is driven by many stocks or just a few heavyweights. An S&P 500 rising because 7 mega-caps are up is less healthy than one rising because 400 stocks are up.

Singularity Trader automatically calculates four NYSE breadth indicators every 3 hours:

A/D Ratio (Advance/Decline) — ratio of advancing to declining stocks on the NYSE. Values > 2.0 = broadly supported rally; < 0.5 = broad selloff.
McClellan Oscillator — smoothed breadth momentum indicator. Positive = broad upward thrust, negative = broad downward thrust. Zero-line crossings are classic signals.
NYSE > 50d MA — percentage of NYSE stocks above their 50-day average. > 70% = hot (risk of overheating), < 30% = cold (potential setup environment).
High/Low Ratio — ratio of new 52-week highs to lows. Divergences from the index are often early warning signals.

Where you see this:
• In the Trading Lights modal as the third macro indicator
• In the Markets tab as its own metric row
• On the dashboard under "Market Context"
• As a detail heatmap on the market analysis page

In one sentence: Breadth green = "The market is carrying you"; breadth red = "You're swimming against the current".

25. COT Analysis — What the Big Players Are Actually Doing

The COT Report (Commitments of Traders) is published weekly by the CFTC and shows net positions of large institutional traders in futures markets. Singularity Trader imports this data automatically and presents it in structured form.

Why is this interesting?
If Commercial Hedgers (e.g., gold mines, oil companies) are rarely this long historically — it's often a signal they expect a bottom. If Large Speculators are extremely bullish, a trend reversal is often imminent.

What you'll find:
Heatmap overview — all available futures markets (Gold, Oil, S&P, EUR, Bitcoin, …) with their current COT status
COT Index (52 weeks) — normalized: 0% = extreme bearish, 100% = extreme bullish in 1-year history
Detail view per market — historical charts of Commercial, Large Speculator, and Small Trader positions with price chart overlay
Related instruments — e.g., Gold COT also shows Silver, Platinum, GLD ETF flows
Signal labels — "Commercial Extreme Long" / "Speculator Extreme Short" etc., when a market hits its 5-year extreme

Data is updated every Friday evening (after CFTC release). Accessible via sidebar Market Analysis → COT.