Markdown Components Reference

Live showcase of every supported markdown component — rendered exactly as it appears in articles. Use this page to verify rendering after index.php changes. Full syntax spec: note/markdown/MARKDOWN-COMPONENTS.md.


1. Callout Blocks

Four types: tip, warning, danger, info. PHP fenced block → styled div with colored left border.

💡 TIP
Use limit orders for better fills on momentum entries. Market orders during high volatility gap your fill price significantly.
⚠️ WARNING
This strategy requires SIP data. IEX-only feeds will produce incorrect signals on sub-minute entries.
🚨 DANGER
Never size above 2% risk per trade during high-volatility sessions. One gap open can exceed your stop.
ℹ️ INFO
The NBBO updates faster than most retail feeds can consume. Polygon Advanced delivers SIP data with approximately 1ms latency.

2. Syntax Highlighting

Prism.js 1.29.0 with autoloader. Use standard fenced blocks with a language tag. Supported: python, javascript, bash, sql, json, css, php, and any Prism-supported language.

Rendered — Python:

def position_size(capital: float, risk_pct: float, stop_distance: float) -> float:
    """Kelly-safe position sizing: risk fixed % of capital per stop distance."""
    return (capital * risk_pct) / stop_distance

# Example: $50k account, 1% risk, $0.50 stop
shares = position_size(50_000, 0.01, 0.50)
print(f"Position size: {shares:.0f} shares")  # 1000 shares

Rendered — JavaScript:

const calcRiskReward = (entry, stop, target) => {
  const risk   = Math.abs(entry - stop);
  const reward = Math.abs(target - entry);
  return (reward / risk).toFixed(2);
};

console.log(calcRiskReward(185.20, 184.80, 186.20)); // "2.50"

Rendered — Bash:

# Deploy article to oyamori server
scp -i ~/.ssh/id_rsa article.md root@162.0.222.119:/home/logiceverything/oyamori/learning/_content/
ssh -i ~/.ssh/id_rsa root@162.0.222.119 \
  "chown logiceverything:logiceverything /home/logiceverything/oyamori/learning/_content/article.md"

Rendered — JSON:

{
  "symbol": "AAPL",
  "side": "buy",
  "qty": 100,
  "type": "limit",
  "limit_price": "185.20",
  "time_in_force": "day"
}

3. TradingView Charts — Candlestick

Standard chart with lines:, markers:, and vlines:.

Candlestick — Lines, Markers, Vlines


4. TradingView Charts — Zones

zones: draws a price band using two createPriceLine() calls — upper line labeled, lower unlabeled.

Syntax:

    zones:
      - { price_hi: 184.50, price_lo: 183.00, color: "#ef4444", label: "Resistance Zone" }

Rendered:

Candlestick — Zones (Price Bands)


5. TradingView Charts — Line and Area

Line Chart

Area Chart


6. TradingView Charts — Histogram and Bar

Histogram (Volume-style)

Bar Chart (OHLC, no color)

trendlines: draws diagonal lines using LWC series primitives. Lines extend across the full chart width. Fields: time1, price1, time2, price2 (required) · color · label · width · style: solid|dashed.

Trendlines demo


7. Tables

Standard GFM tables with alignment.

Component Block type Status Complexity
Callout blocks tip / warning / danger / info DONE Easy
Syntax highlighting python / javascript / bash DONE Easy
Stat cards stats DONE Easy
Mermaid diagrams mermaid DONE Medium
Math / KaTeX KaTeX display and inline math DONE Medium
Tabs tabs DONE Medium
Collapsible details DONE Easy
Raw HTML html DONE Easy
Comparison table compare DONE Medium
Calculators calc type:position-size etc. DONE Hard

8. Standard Markdown

Headings

# H1 through ###### H6 — H1 reserved for article title, use H2–H4 in body.

Text Formatting

Bold**text**
Italic*text*
Strikethrough~~text~~
Inline code`code`

Blockquote

"Price action is structure plus context, not structure alone. Structure is the entry trigger. Conviction validates the move."

Syntax: > text

Unordered List

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item

Ordered List

  1. Pre-market scan — macro backdrop check
  2. Sentiment gate — news score above threshold
  3. Technical confirmation — two aligned signals
  4. Entry — limit order, sized to 1% risk

Horizontal Rule

--- produces:


Inline Code

Use backticks for function_names(), variable_names, file/paths, and short commands.

Links

Oyamori Learning Hub — standard markdown link syntax.


Chart Color Reference

Purpose Color Preview
Entry arrow #D5477F Brand pink
Exit arrow #888888 Muted gray
Resistance line #ef4444 Red
Support line #10b981 Green
Target / pivot #f59e0b Amber
Event vline #f59e0b Amber
Neutral zone #888888 Gray

9. Math — KaTeX

Block math uses double-dollar display mode — centered on its own line. Inline math uses backslash-paren notation inside running text. KaTeX 0.16.9 injected only on articles that contain math. Delimiters chosen to avoid conflict with plain currency values like $100.

Rendered — Kelly Criterion (block):

Where = win probability, = loss as fraction of capital, = gain as fraction of capital.

Rendered — Sharpe Ratio:

Where is expected excess return over the risk-free rate, and is the portfolio standard deviation.

Rendered — Position Sizing:

Rendered — Maximum Drawdown:

Rendered — inline example:

The profit factor is . A value above is considered a viable edge; above is strong.


10. Tabs

[Tab Name] headers inside a fenced tabs block → tabbed panels. Inner content parsed as full markdown. Inline JS injected once per page only when tabs are present.

Rendered — Position sizing across languages:

position_size = capital * risk_pct / stop_distance

$50k · 1% risk · $0.50 stop → 1,000 shares

Rendered — Strategy comparison:

Holding: Seconds to 30 min

55–65%
Win Rate
0.5–2%
Target
0.25–0.75%
Risk Per Trade
4–8 hrs/day
Screen Time

Best for traders who can monitor tick-by-tick and exit without hesitation on momentum loss.


11. Stat Cards

Key: Value pairs → flex grid of metric cards. Optional color hint via Key[color]: Value. Colors: green, red, amber, blue, muted. Default color is brand pink.

Rendered — Strategy summary (with color hints):

62%
Win Rate
$340
Avg Profit
$180
Avg Loss
1.89
Profit Factor
8.2%
Max Drawdown
1.43
Sharpe Ratio

Rendered — Data feed comparison (default colors):

~10%
IEX Coverage
100%
SIP Coverage
~1ms
Polygon Latency
$0/mo
Free Feed Cost
$29/mo
Polygon Starter
$1,000+/mo
Direct SIP

Rendered — Mixed muted/blue:

30–240 min
Holding Period
Limit order
Entry Type
1–2%
Risk Per Trade
+1.5–3%
Target
–1%
Stop
2–4 hrs/day
Time at Screen

12. Collapsible Sections

Native HTML <details> — no JS. Title on same line as the fence tag. Inner body is full markdown.

Why does IEX miss 85% of trades?

IEX is a single exchange in a fragmented 16-exchange market. It captures roughly 5–15% of total equity volume on any given stock. The remaining 85–95% executes on NYSE, NASDAQ, BATS, Cboe, and the other venues. Each exchange operates independently with its own order book — trades on NASDAQ do not automatically appear in the IEX feed.

What is the difference between last trade price and NBBO ask?

Last trade price is historical — it tells you where the most recent fill happened, on any exchange. It may be seconds old.

NBBO ask is the current best available price across all 16 exchanges right now. When you place a market order, this is the price you will actually pay.

The two diverge under fragmented or fast-moving conditions. A bot using last trade price as its entry reference is comparing against a stale number.

When should I upgrade from a free data feed?
  • Paper trading / swing holds (multi-day): Free IEX-based feed is fine. The lag is irrelevant at daily timeframes.
  • Intraday strategies (30 min – 4 hr holds): Polygon Starter ($29/mo) minimum. SIP-consolidated coverage.
  • Sub-minute scalping: Polygon Advanced or IBKR feed. Validate NBBO on every signal before entry.
  • Sub-second execution: Direct SIP feed or co-located infrastructure. Free feeds are not viable.

13. Mermaid Diagrams

Mermaid 11 via ESM CDN. Injected only on articles that contain mermaid blocks. Supports flowchart, sequence, ER, pie, timeline, gitgraph, and more.

Rendered — Trade Decision Flowchart:

flowchart TD A([Pre-market scan]) --> B{Macro backdrop bullish?} B -- Yes --> C{Sentiment score > 60?} B -- No --> X([Skip today]) C -- Yes --> D{Technical setup found?} C -- No --> X D -- Yes --> E[Size position\n1% risk rule] D -- No --> X E --> F([Place limit order])

Rendered — Data Pipeline Sequence:

sequenceDiagram participant Bot participant Feed participant Broker participant Market Bot->>Feed: Subscribe to price stream Feed-->>Bot: NBBO tick (SIP-consolidated) Bot->>Bot: Evaluate signal conditions Bot->>Broker: Place limit order (NBBO ask) Broker->>Market: Route to best exchange Market-->>Broker: Fill confirmation Broker-->>Bot: Order filled @ $185.21

Rendered — Pie Chart:

pie title US Equity Volume by Exchange Group (approx) "NASDAQ group" : 32 "NYSE group" : 24 "Cboe group" : 22 "IEX" : 3 "MEMX / Other" : 19

14. Comparison Table

[Column Name] headers + Key: Value pairs → aligned comparison grid. Rows auto-aligned across all columns. Missing values show . Supports same [color] hint as stat cards.

Rendered — Data feed comparison:

IEX FreePolygon StarterIBKR FeedDirect SIP
CoverageIEX only (~10% vol)SIP-consolidatedAggregated (near-SIP)All 16 exchanges
LatencyLow~1–5msLowLowest
CostFree$29/moIncluded with account$1,000+/mo
Best ForPaper trading, learningSwing / position botsAny IBKR botInstitutional / HFT
NBBO AccessNoYesYesYes

Rendered — Trading style comparison:

ScalperDay TraderSwing Trader
Holding TimeSeconds–30 min30 min–4 hrsDays–weeks
Win Rate55–65%50–60%45–55%
Per-Trade Target0.5–2%1–3%3–10%
Risk Per Trade0.25–0.75%1–2%1–2%
Screen Time4–8 hrs/day2–4 hrs/day30 min/day
Data Feed NeededSIP requiredAggregatedFree IEX fine

15. Raw HTML Passthrough

```html fence → content passed directly to page output, no escaping. Use for iframes, custom embeds, or any layout not covered by other components. Server-authored content only — never pipe user input through this.

Rendered — Custom callout with inline style:

KEY TAKEAWAY
Free IEX feeds miss 85–95% of trades. Your bot fires on incomplete data, but executes at the real NBBO. That gap between signal price and fill price destroys scalp edge.

Rendered — Two-column layout:

IEX Feed
~10% coverage
Only trades on IEX exchange. Misses NYSE, NASDAQ, BATS, Cboe.
SIP Feed
100% coverage
All 16 exchanges consolidated. Official NBBO. What Bloomberg uses.

Rendered — YouTube embed:


16. Interactive Calculators

calc type:{name} → self-contained interactive widget. Pure HTML + inline JS, no external dependencies. Four built-in types. Multiple calculators on same page use isolated IDs — no conflicts.

Available types: position-size · kelly · risk-reward · drawdown

Syntax: Fenced block with type: on the opening line — no body needed.


Position Size Calculator

Position Size Calculator

Kelly Criterion Calculator

Kelly Criterion Calculator

Risk / Reward Calculator

Risk / Reward Calculator

Drawdown Calculator

Drawdown Calculator

MC-11 — Widget Embeds

Use for: Interactive HTML tools, visualizers, and reference guides that go beyond what native markdown components can do. Widgets are self-contained single-file HTML apps hosted on the server.

💡 TIP
Widgets auto-expand to their full content height — no scrollbar, no fixed height needed. They look like native page content.

Syntax — inline shortcode, place on its own line:

ℹ️ INFO
[widget file='slug_name'] — where slug_name matches the filename without .html

Example — Options Trading Jargon Guide:

File → URL mapping:

Widget FileShortcodeFull Screen URL
Location/widgets/files/
Formatunderscoresunderscores or hyphenshyphens
Exampleoptions_trading_guide.htmloptions_trading_guide/widgets/options-trading-guide/
Syntax[widget file='...']
Route/widgets/{slug}/

Requirements for new widget HTML files:

Prevents height measurement being capped
No min-height: 100vh
Required for auto-height to work
postMessage script
Needed if widget has internal tabs/toggles
sendHeight on state change
Files in /widgets/files/ are publicly accessible
Public URL

Notes: Processed after Parsedown on final HTML. Error shown if file not found. Gallery of all widgets at oyamori.com/widgets/.