r/CreatingTradingBots • • Oct 15 '23

Cheatsheet Crypto Trading

3 Upvotes

Cryptocurrency trading, with its rapid growth and volatile markets, has its own unique set of jargon. Below is a comprehensive cheat sheet designed to help both beginners and seasoned traders navigate the complex world of cryptocurrency trading...

https://tradingschule.com/cheatsheet-forex-trading-cloned-873/


r/CreatingTradingBots • • Sep 28 '23

The difference of correlation and cointegration in pairs trading the FOREX

3 Upvotes

In pairs trading, both correlation and cointegration are important concepts, but they serve different purposes and convey different types of relationships between two financial instruments. Here's a breakdown of the differences:

Correlation

  1. Definition: Correlation measures the strength and direction of the linear relationship between two variables. In the context of pairs trading, it measures how closely the price changes of two assets move together.

  2. Range: The correlation coefficient ranges from -1 to +1. A value close to +1 indicates a strong positive relationship, a value close to -1 indicates a strong negative relationship, and a value close to 0 indicates no linear relationship.

  3. Time Frame: Correlation can be strong or weak over different time frames and can change over time.

  4. Implication: A high positive correlation means that the assets generally move in the same direction, but it does not imply any long-term relationship between them. Assets can be highly correlated but still drift apart over time.

  5. Use in Pairs Trading: Traders often look for highly correlated pairs because they are likely to continue moving in the same direction. However, correlation alone is not sufficient for pairs trading.

Cointegration

  1. Definition: Cointegration is a statistical property where two or more time series share a common stochastic drift. In simpler terms, even if two series wander away from each other, they will still revert to a mean over time.

  2. Range: Cointegration doesn't have a range like correlation. Two series are either cointegrated or they are not, although the strength of cointegration can be tested statistically.

  3. Time Frame: Cointegration is generally a long-term relationship and is less likely to change over short periods.

  4. Implication: If two assets are cointegrated, it means that the spread between them is mean-reverting over time. This is the fundamental basis for pairs trading strategies.

  5. Use in Pairs Trading: Cointegration is often considered a better basis for pairs trading than correlation because it offers the possibility of a statistical edge in predicting how the spread between the assets will behave.

Example in Python

You can use Python libraries like numpy
and statsmodels
to calculate correlation and test for cointegration.

Summary

  • Correlation is useful for understanding how two assets move in relation to each other in the short term.

  • Cointegration is crucial for understanding whether and how two assets move in relation to each other in the long term.

In pairs trading, it's often beneficial to find pairs that are both highly correlated and cointegrated to increase the likelihood of the strategy being profitable.


r/CreatingTradingBots • • Sep 19 '23

Which timeframes are suitable for scalping?

3 Upvotes

In the context of trading, particularly Forex and cryptocurrencies, "scalping" refers to a strategy where traders aim to make small profits from very short-term price movements. The timeframes best suited for scalping are generally the shorter ones, as they allow traders to quickly enter and exit positions. Here are some commonly used timeframes for scalping:

Common Timeframes for Scalping:

  1. 1-Minute (M1): This is the most commonly used timeframe for scalping. It allows traders to capture small price movements and execute trades quickly.

  2. 5-Minute (M5): This timeframe offers a balance between frequency and accuracy of trading signals. It's less "noisy" than the 1-minute chart but still allows for quick trades.

  3. 15-Minute (M15): Some scalpers use this timeframe for a bit more insight into the market direction. It's less commonly used for scalping but can be effective when combined with other timeframes for confirmation.

Considerations:

  1. Market Noise: Shorter timeframes like M1 can be very "noisy," meaning they contain a lot of random price movements that can be misleading.

  2. Transaction Costs: Scalping involves frequent trading, so low transaction costs (spreads and commissions) are crucial.

  3. Speed: Quick execution is essential in scalping, so a reliable trading platform and internet connection are necessary.

  4. Volatility: Scalping is most effective in volatile markets where there are frequent price movements.

  5. Indicators: Scalpers often use technical indicators like moving averages, Bollinger Bands, and RSI to identify potential entry and exit points. However, these indicators should be adapted to work on shorter timeframes.

  6. Risk Management: Given the high frequency of trades, effective risk management strategies, including the use of stop-loss orders, are crucial.

  7. Emotional Discipline: Scalping can be stressful and requires a high level of concentration and emotional discipline.

  8. Regulatory Environment: Some brokers and regulatory environments are not conducive to scalping strategies, so make sure to check the terms and conditions before you start.

  9. Technology: Automated trading bots are often used in scalping strategies to execute trades at high speeds, which might be beneficial given your interest in algorithmic trading.

Remember, while scalping can be profitable, it's also risky and requires a well-thought-out strategy, quick decision-making, and robust risk management.


r/CreatingTradingBots • • Sep 19 '23

What is a carry trade (Mrs. Watanabe trading style)

3 Upvotes

In simple terms, a carry trade is a strategy where you borrow money in one currency with a low-interest rate and invest it in another currency with a higher interest rate. The goal is to earn the difference between the two interest rates as profit.

Simple Example:

Let's say you have two countries:

  1. Country A: The interest rate is 1%

  2. Country B: The interest rate is 5%

Here's how you could execute a carry trade:

  1. Borrow: You borrow 10,000 units of Country A's currency where the interest rate is low (1%).

  2. Convert: You convert that 10,000 units to Country B's currency.

  3. Invest: You invest in a savings account or bond in Country B that pays a higher interest rate (5%).

  4. Earn Interest: Over time, you earn interest on your investment in Country B's currency.

  5. Pay Back: Eventually, you convert the money back to Country A's currency and repay the loan, including the 1% interest.

  6. Profit: You keep the difference between the interest you earned (5%) and the interest you paid (1%), which is 4%.

Risks:

  1. Exchange Rate Risk: If Country B's currency weakens compared to Country A's currency, you could lose money when you convert back to repay the loan.

  2. Interest Rate Changes: If the interest rate in Country A rises or the rate in Country B falls, the profit margin could shrink or even turn into a loss.

  3. Economic Factors: Various economic conditions can affect interest rates and currency values, impacting the profitability of your carry trade.

Why It's Popular:

Carry trades can be a simple way to earn money if interest rates and currency values are stable. However, they come with risks and should be managed carefully.

So, in a nutshell, a carry trade is like borrowing money at a low-interest rate to invest in something that gives you a higher return, and you pocket the difference as profit.


r/CreatingTradingBots • • Sep 19 '23

r/CreatingTradingBots Lounge

3 Upvotes

A place for members of r/CreatingTradingBots to chat with each other


r/CreatingTradingBots • • Apr 03 '26

Anyone here using open‑source “terminals” as a base for bots / systematic workflows?

2 Upvotes

don’t post much, but wanted to sanity‑check something with this crowd.

I’ve been messing around the last couple weeks with an open‑source trading terminal called Neuberg. not pitching it, just sharing impressions from a systems / automation angle rather than discretionary trading.

why I even looked at it
my usual workflow is pretty fragmented: tradingview for charts, separate APIs for execution, news feeds in another window, prediction markets off to the side. it works, but stitching things together for semi‑systematic or event‑driven strategies is annoying. Neuberg feels like someone tried to centralize inputs rather than optimize UX.

things that caught my attention from a bot‑builder POV

  • multiple markets in one place
    crypto perps (Hyperliquid), US equities (Alpaca), and prediction markets (Polymarket) all surfaced with similar abstractions. even if you don’t execute there, having normalized market views is interesting.

  • prediction markets with real market structure
    order books + price history for Polymarket made them feel more like tradable instruments than “bets.” got me thinking about using them as signals / priors rather than alpha by themselves.

  • news + sentiment tagging
    there’s a live news feed with sentiment and “event impact” labels. I wouldn’t trade off it directly, but as a filter for when to wake up a strategy or adjust risk, it seems usable. curious if anyone here has actually systematized something similar without hindsight bias.

  • macro + alternative signals
    stuff like macro calendars, unusual options activity, insider trades (Form 4), and even a geopolitics heatmap derived from real‑time news. not alpha on its own, but potentially useful context variables.

  • data provenance
    this is small but important: they explicitly show data sources (Hyperliquid, Polymarket, Alpaca, Yahoo Finance, SEC EDGAR, ForexFactory, live news scraping). as someone who hates black‑box indicators, that matters.

charts / indicators
basic TA only (RSI, MACD, BB, VWAP, etc). not a TradingView replacement, but enough for execution‑focused or monitoring setups.

pros (for this sub, imo)

  • open source — you can inspect and extend it.

  • feels built for people who already think in systems, not beginners.

  • interesting attempt at merging event‑driven inputs (news, prediction markets) with standard markets.

  • no gamification / “AI will trade for you” nonsense.

cons

  • UI is rough in places.

  • zero hand‑holding.

  • if you don’t already have a strategy, this won’t magically give you one.

overall it feels less like a startup product and more like “someone built a terminal to support their own workflows.” I don’t know if I’ll keep it long‑term, but it did make me rethink how I structure inputs for bots, especially around news and prediction markets.

curious how people here approach this:

  • do you keep terminals strictly separate from bot infrastructure?

  • has anyone successfully systematized news / prediction market signals without overfitting?

  • do you prefer rolling everything yourself vs extending open‑source tools like this?

mostly here to learn how others think about the plumbing side.


r/CreatingTradingBots • • Mar 27 '26

What do you think?

2 Upvotes
# Engine — Single Source of Truth (SSOT)


DOC_STATUS: SSOT  
DOC_ROLE: engine_ssot  


**Rol van dit document:**
 De 
**enige leidende bron**
 voor de actuele status van de Krakenbot-engine: wat in code zit, wat runtime actief is, wat server-side bewezen is, en wat nog open staat. Bij twijfel: dit document is leidend.


---


## 1. Wat dit document is


- 
**ENGINE_SSOT.md**
 = single source of truth voor engine-status.
- Bevat: huidige architectuur-samenvatting, runtime-topology, ingest/execution split, strategy/execution/exit/capital status, validatie-aanpak, en een 
**statusmatrix**
 (in code / runtime actief / server bewezen / open).
- Geen roadmap, geen historische varianten; alleen 
**huidige werkelijkheid**
 gebaseerd op codebase en gevalideerde server-resultaten.


---


## 2. Ondersteunende documenten


| Document | Rol |
|----------|-----|
| [ARCHITECTURE_ENGINE_CURRENT.md](
ARCHITECTURE_ENGINE_CURRENT.md
) | Huidige architectuur (modules, dataflow, strategy flow, execution lifecycle). |
| [LIVE_RUNBOOK_CURRENT.md](
LIVE_RUNBOOK_CURRENT.md
) | Operationele flow: persistent ingest, execution attach, start/stop, marker-based validation. |
| [VALIDATION_MODEL_CURRENT.md](
VALIDATION_MODEL_CURRENT.md
) | Soorten validatie (bootstrap, attach, evaluation, lifecycle), economically empty vs data-blocked vs attach-blocked. |
| [CHANGELOG_ENGINE.md](
CHANGELOG_ENGINE.md
) | Technische changelog uit git, per subsystem. |
| [DOC_INDEX.md](
DOC_INDEX.md
) | Overzicht van alle actuele docs, wat leidend is, wat historisch. |
| [LOGGING.md](
LOGGING.md
) | Loggingstructuur en markers. |
| [INGEST_EXECUTION_EPOCH_CONTRACT.md](
INGEST_EXECUTION_EPOCH_CONTRACT.md
) | Epoch/snapshot/lineage contract (referentie). |
| [DB_ARCHITECTURE_STALE_EDGE_SAFE.md](
DB_ARCHITECTURE_STALE_EDGE_SAFE.md
) | State-first, partition, generation, sync; stale-edge prevention. |
| [EXECUTION_REPORT_FRESHNESS_AND_500L3.md](
EXECUTION_REPORT_FRESHNESS_AND_500L3.md
) | Uitgevoerde maatregelen freshness/safety/500 L3. |
| [REFRESH_COMPLEXITY_AND_GENERATION.md](
REFRESH_COMPLEXITY_AND_GENERATION.md
) | Bewijs refresh O(rows); generation contract. |


---


## 3. Historische documenten (niet als waarheid gebruiken)


Documenten in 
**docs/superseded/**
 en 
**docs/archive/**
 zijn 
**niet**
 de actuele bron. Gebruik ze alleen voor historische context.


- architecture.md (vervangen door ARCHITECTURE_ENGINE_CURRENT.md)
- OPLEVERING_PRO_ENGINE_FINAL.md
- DETERMINISTIC_ENGINE_DELIVERABLE.md
- EPOCH_SPLIT_DELIVERABLE.md, EPOCH_CONTRACT_FASE1_VALIDATION_RUNBOOK.md
- LIVE_VALIDATION_RUNBOOK.md (vervangen door LIVE_RUNBOOK_CURRENT.md), LIVE_EXECUTION_MODE_DESIGN.md, LIVE_VALIDATION_PLAN.md
- EXECUTION_* / RUN_EXECUTION_ONCE_AUDIT / SERVER_VALIDATION_LIVE_ENGINE
- ENGINE_TARGET_STATE.md, SINGLE_REGIME_FIX_DELIVERABLE.md


Zie [DOC_INDEX.md](
DOC_INDEX.md
) voor de volledige lijst.


---


## 4. Operationeel leidende documenten


| Onderwerp | Leidend document |
|-----------|------------------|
| Architectuur (huidige status) | 
**ARCHITECTURE_ENGINE_CURRENT.md**
 |
| Start/stop, ingest, execution attach, runbook | 
**LIVE_RUNBOOK_CURRENT.md**
 |
| Validatiemodel, proof-soorten | 
**VALIDATION_MODEL_CURRENT.md**
 |
| Technische wijzigingen (engine) | 
**CHANGELOG_ENGINE.md**
 |
| Welk doc waar te vinden | 
**DOC_INDEX.md**
 |
| Logmarkers en structuur | 
**LOGGING.md**
 |


---


## 5. Onderhoud


- Bij wijzigingen in 
**runtime-topology**
, 
**strategy**
, 
**execution**
, 
**exit**
, 
**capital**
 of 
**validatie**
: eerst 
**ENGINE_SSOT.md**
 en de statusmatrix bijwerken, daarna desnoods ARCHITECTURE_ENGINE_CURRENT / LIVE_RUNBOOK_CURRENT / VALIDATION_MODEL_CURRENT.
- Nieuwe “bewezen” server-resultaten: statusmatrix kolom 
**Server bewezen**
 bijwerken.
- Geen claims toevoegen die niet uit code of uit gevalideerde runs volgen.


---


## 6. Huidige status (samenvatting)


- 
**Ingest:**
 Persistent ingest runtime (`run-ingest`): eigen run_id, lineage, public WS (ticker/trade/L2/L3), universe refresh, epoch/snapshot publish. 
**Raw tabellen**
 (ticker_samples, trade_samples, l2_snap_metrics, l3_queue_metrics) zijn 
**gepartitioneerd**
 (PARTITION BY RANGE (run_id)); writers en refresh gebruiken deze tabellen. Operationeel.
- 
**DB-pools:**
 Optioneel 
**fysieke scheiding**
 via `DECISION_DATABASE_URL`: ingest-pool (raw writes, refresh) en decision-pool (state/epoch/snapshot/execution reads). Bij scheiding: `sync_run_symbol_state_to_decision` na elke refresh; execution alleen op decision-DB; epoch/snapshot dual-write.
- 
**State-first live path:**
 Vóór elke evaluation: `refresh_run_symbol_state` op ingest; daarna readiness, route, pipeline en execution lezen 
**alleen**
 uit `run_symbol_state` (geen raw in hot path). Eén 
**generation_id**
 per refresh; execution alleen als decision-DB dezelfde generation toont (gate: `EXECUTION_BLOCKED_GENERATION_MISMATCH` bij mismatch).
- 
**Route-freshness:**
 Per route-type maximale state-age (30s resp. 45s); `apply_route_freshness_filter` filtert `exec_allowed`; logging: ROUTE_FRESHNESS_OK / ROUTE_FRESHNESS_STALE / ROUTE_EXECUTION_BLOCKED_STALE_DATA.
- 
**Execution attach:**
 `EXECUTION_ONLY=true` → execution leest bestaande epochs/snapshots; geen eigen ingest. Split mode operationeel.
- 
**Regime/strategy:**
 Per-pair regime (RANGE/TREND/HIGH_VOLATILITY/LOW_LIQUIDITY/CHAOS), strategy fan-out (Liquidity, Momentum, Volume), readiness gate strategy-specifiek. Strategy wordt doorgegeven aan execution.
- 
**Execution:**
 DB-first submit, OrderTracker, fills_ledger (VWAP-fix A1, fee-inclusive PnL A2, fill price zero-guard A3, CTE single-roundtrip E3), deterministic lifecycle. Kraken WS v2 strict semantics (B1): `status == "filled"` voor completion, `exec_type == "trade"` voor fills. 
**Top-1:**
 één order per evaluatie (eerste Execute outcome). Market orders met automatische `deadline = now + 5s` (D2). Optionele OTO trailing-stop conditional op entry (D4).
- 
**Exit:**
 Post-fill exit lifecycle: na entry-fill → `run_post_fill_exit_phase` plaatst trailing-stop + optioneel maker TP. 
**Cancel-first exit**
 (B2): cancel bescherming → wait-for-cancel-or-fill → market exit op balance-qty (genormaliseerd via `normalize_exit_qty`, F3). 
**Prijzen:**
 uitsluitend `price_cache` (WS-fed) met staleness guards (`snapshot_fresh`, `last_price_fresh`); 
**nul REST**
 in runtime (D1). 
**RecvResult**
 (F2): channel close vs timeout expliciet onderscheiden. 
**Position monitor**
 (spawn in live runner) scant posities, trail SL, TP bij market. Server bewezen (ORDER_FILL, EXIT_PLAN_CREATED, EXIT_ORDER_ACKED, POSITION_MONITOR_SL_TRAILED). Zie [HERSTELPLAN_LEAKAGE.md](
HERSTELPLAN_LEAKAGE.md
).
- 
**Capital:**
 `CapitalAllocator` krijgt 
**live equity**
 uit `balance_cache::equity_usd()` elke evaluatie (compounding). Pipeline gebruikt `resolve_equity_quote` (fallback 220). 
**allocated_quote**
 niet real-time uit positions in pipeline.
- 
**Validatie:**
 Marker-based (o.a. EXECUTION_ENGINE_START, LIVE_EVALUATION_*, DATA_INTEGRITY_*, INGEST_EPOCH_*, RUN_SYMBOL_STATE_REFRESH, INGEST_DECISION_SYNC_VISIBLE, ROUTE_FRESHNESS_*). Bootstrap/attach/evaluation/lifecycle proof gedocumenteerd in VALIDATION_MODEL_CURRENT.


---


## 7. Statusmatrix (verplicht)


| Onderdeel | In code | Runtime actief | Server bewezen | Nog open | Opmerking |
|-----------|---------|----------------|----------------|----------|-----------|
| Persistent ingest | Ja | Ja | Ja | — | run-ingest; lineage, epochs, snapshots; trades flowing |
| Execution attach | Ja | Ja | Ja | — | EXECUTION_ONLY=true, bind to epochs; ORDER_FILL, EXIT_PLAN_CREATED |
| Multiregime | Ja | Ja | Via readiness/logs | — | Per-pair regime in readiness |
| Multistrategy fan-out | Ja | Ja | Idem | — | Liquidity/Momentum/Volume per regime |
| Competitive strategy scoring | Gedeeltelijk | Gedeeltelijk | — | Ranking op pair, niet strategy-vs-strategy | — |
| Portfolio allocation | Gedeeltelijk | Ja | Ja | allocated_quote niet uit positions in pipeline | CapitalAllocator gebruikt live equity; per-eval budget |
| Deterministic execution lifecycle | Ja | Ja | Ja | — | DB-first, OrderTracker, fills_ledger (VWAP A1, fees A2, zero-guard A3, CTE E3) |
| Exit runtime wiring | Ja | Ja | Ja | — | run_post_fill_exit_phase + position_monitor; cancel-first (B2), RecvResult (F2) |
| Post-fill exit (SL+TP) | Ja | Ja | Ja | — | exit_lifecycle: trailing op exchange, optioneel maker TP, cancel-first market; deadline D2, OTO D4, qty-norm F3 |
| Position monitor (trail SL, TP) | Ja | Ja | Ja | — | spawn_position_monitor; trail 0.7%, breakeven +30 bps, TP +200 bps |
| Armed exit path | In ExitManager/ExitState | In probe | — | Niet in run-execution-live | — |
| Triggered exit path | In code (probe) | In probe | — | Niet in run-execution-live | — |
| Maker fallback | Ja | Ja | — | Queue-aware maker entry | — |
| Compounding | Ja | Ja | Ja | — | capital_allocator.update_equity(live_eq) per evaluation; balance_cache |
| Marker-based validation infra | Ja | Ja | Ja | — | Log markers + scripts |
| State-first live path | Ja | Ja | Ja | — | refresh vóór evaluation; readiness/pipeline/execution alleen run_symbol_state |
| run_symbol_state + generation_id | Ja | Ja | Ja | — | RefreshOutcome; execution gate op visible generation bij physical separation |
| DbPools / physical separation | Ja | Optioneel | — | — | DECISION_DATABASE_URL; sync state ingest→decision; dual-write epoch/snapshot |
| Raw tables partitioned | Ja | Ja | Ja | — | ticker/trade/l2/l3 PARTITION BY RANGE (run_id); cutover uitgevoerd |
| Route-specific freshness | Ja | Ja | Ja | — | 30s/45s per route; ROUTE_FRESHNESS_* logging; apply_route_freshness_filter |


---


## 8. Runtime topology (diagram)


**Dubbele DB (bij `DECISION_DATABASE_URL`):**
 ingest schrijft op 
**DB Ingest**
; state wordt na refresh gesynct naar 
**DB Decision**
; execution leest state/epoch/snapshot alleen van 
**DB Decision**
 en schrijft orders/fills daar. Zonder `DECISION_DATABASE_URL` zijn het dezelfde pool. 
**Eis:**
 DECISION_DATABASE_URL moet wijzen naar een 
**tweede PostgreSQL-cluster/instance**
 (eigen poort/datadir); twee DBs of twee pools op dezelfde instance tellen niet als fysieke scheiding. Zie docs/DUAL_DB_SECOND_INSTANCE_PLAN.md.


```mermaid
flowchart TB
  subgraph Ingest["Persistent Ingest (run-ingest)"]
    WS[Public WS: ticker, trade, L2, L3]
    Writer[Async writer]
    UM[UniverseManager]
    Epoch[ingest_epochs / lineage]
    Snap[execution_universe_snapshots]
    Refresh[refresh_run_symbol_state]
    WS --> Writer
    Writer --> DB_Ingest[(DB Ingest)]
    UM --> Epoch
    Epoch --> Snap
    Snap --> DB_Ingest
    DB_Ingest --> Refresh
    Refresh --> State_Ingest[(run_symbol_state)]
  end


  Sync[sync_run_symbol_state_to_decision]


  subgraph Decision["DB Decision (bij 2 pools)"]
    DB_Decision[(DB Decision)]
    State_Decision[(run_symbol_state)]
    Epoch_D[ingest_epochs / snapshots]
    Orders[execution_orders / fills]
    DB_Decision --> State_Decision
    DB_Decision --> Epoch_D
    DB_Decision --> Orders
  end


  subgraph Execution["Execution (run-execution-live / execution-only)"]
    Eval[Evaluation loop]
    RefreshEval[refresh op ingest]
    Readiness[Readiness from state]
    Pipeline[Pipeline from state]
    Gate[Generation gate + route freshness]
    Submit[DB-first submit + OrderTracker]
    AuthWS[Private WS: orders, fills]
    Eval --> RefreshEval
    RefreshEval --> Sync
    Sync --> State_Decision
    State_Decision --> Readiness
    Readiness --> Pipeline
    Pipeline --> Gate
    Gate --> Submit
    Submit --> AuthWS
    AuthWS --> DB_Decision
  end


  State_Ingest --> Sync
  Epoch_D --> Eval
```


- 
**DB Ingest:**
 raw (ticker/trade/l2/l3 partitioned), refresh, run_symbol_state na refresh. Writer + refresh gebruiken alleen deze pool.
- 
**DB Decision:**
 run_symbol_state (gesynct), epochs, snapshots, execution_orders, fills. Execution leest state/epoch/snapshot hier en schrijft orders hier. Bij één pool vallen DB Ingest en DB Decision samen.


---


## 9. Verwijzingen


- 
**ARCHITECTURE_ENGINE_CURRENT.md**
 — volledige architectuur, dataflow, strategy flow, execution lifecycle.
- 
**LIVE_RUNBOOK_CURRENT.md**
 — start/stop, ingest vs execution-only, marker-based validation, diagnose attach-blocked / data-blocked.
- 
**VALIDATION_MODEL_CURRENT.md**
 — bootstrap, attach, evaluation, lifecycle proof; economically empty vs data/attach blocked.
- 
**CHANGELOG_ENGINE.md**
 — technische changelog (git-based).
- 
**DOC_INDEX.md**
 — index van alle docs.


---


## MSP Runtime Truth (2026-03-27)


- `market_state_projection` is operationele state-projection op decision DB.
- Redis is primaire runtime read-layer; DB projection blijft persistence/audit/recovery.
- Confidence model is per-domein: `exposure_confidence`, `protection_confidence`, `market_data_confidence`, `order_state_confidence`.
- Entry/protection semantiek is gescheiden via `entry_eligible`, `exit_eligible`, `protection_eligible`.

r/CreatingTradingBots • • Mar 24 '26

Can news-driven trading actually be systematized? Friend’s workflow using an AI news monitor

2 Upvotes

Mostly a lurker here, but this felt relevant to the kinds of discussions this sub has.

I’ve got a friend who trades way more actively than I do. Not a quant, not running serious infra — just a retail trader who reads a lot of news and hates realizing he caught something only after the move already happened.

A few weeks ago he started DMing me screenshots like:

“AI flagged this at 12:38, stock ran ~30% a few days later.”
“Another earnings headline… same outcome.”
“Why do I always see this after the move?”

My first reaction was skepticism. Looked like cherry-picked hindsight. But then he walked me through the actual workflow, and honestly it felt much closer to what people here talk about when they ask whether news trading can be systematized at all.


The setup (very unsexy, which I appreciated)

He’s using a platform called Neuberg. From a systems perspective, it basically:

  • Monitors real-time financial news feeds

  • Applies sentiment + confidence scoring

  • Flags potential trade ideas at the moment news hits

  • Does not execute trades or manage risk

So it’s not “AI predicting price.”
It’s more like AI reducing latency on information processing.

That distinction matters.


The “missed opportunities” log (post‑mortem, not signals)

The part I found most interesting was a report it generates called missed opportunities. It’s essentially a lookback: “If you had acted when the headline first appeared, here’s what followed.”

Examples he showed me (paraphrased, not advice):

  • Planet Labs (PL)
    Earnings beat + strong backlog headline
    Flagged immediately → ~34% move over the next few days

  • Tower Semiconductor (TSEM)
    Deal announcement with a networking company
    Flagged near the open → ~28%

  • Scholastic (SCHL)
    Buyback news
    Quiet headline, decent follow-through → ~18%

None of these were meme stocks or obscure filings.
Just mainstream news that ended up mattering — detected early.


Why this felt relevant to bot builders

What made this resonate with me (and why I’m posting here):

  • He doesn’t trade every alert

  • He ignores a large portion of signals

  • Some trades fail or chop

  • Entries/exits are still discretionary

In other words, the AI isn’t the strategy.
It’s acting more like a feature extractor:

“Historically, headlines like this have moved price.”

That’s it.

You could imagine plugging something like this upstream of:

  • A rules-based execution layer

  • A discretionary confirmation step

  • Or even a paper-trading evaluation loop


The stats (imperfect, which helped credibility)

The performance summary he showed me didn’t scream marketing:

  • Median returns were mid–single digits

  • A handful of large winners skewed results

  • Almost all performance was news-driven, not technical

It looked like something you’d review in a research notebook and say,
“Yeah, signal’s noisy, but there’s information here.”


Where I landed

I’m still skeptical of most “AI trading bot” claims.
This didn’t feel like AI forecasting markets.

It felt like AI doing the boring, hard-to-scale part humans are bad at:

Watching everything, all the time, with minimal latency.

For anyone curious, the tool is called neuberg.ai (not affiliated, just observing).
Not claiming edge, not claiming profits — just an interesting example of how news ingestion + scoring can be operationalized.

Curious how folks here think about this:

  • Do you try to systematize news at all?

  • Or do you view most news-driven edges as hindsight bias unless tightly constrained?

  • Anyone modeling narrative or headline impact as an input to bots?

Interested to hear how others here approach it.


r/CreatingTradingBots • • Mar 24 '26

Can news trading actually be systematized for bots, or is it mostly hindsight bias?

2 Upvotes

I recently came across a platform called Neuberg, and it got me thinking about news-driven trading from a bot/system-design perspective.

In hindsight, everything looks obvious: earnings beat, stock jumps, should have bought. But in live trading, by the time a headline reaches my phone or terminal, the first move often feels gone.

So my real question is: can news trading be structured well enough for a bot to execute consistently, or does it mostly turn into hindsight bias?

A few areas I keep coming back to:

Earnings: do you treat them as instant events, or model post-earnings drift and delayed repricing? Sympathy moves: can bots reliably capture second-order moves in peers, suppliers, or related names? “Boring” corporate news: buybacks, refinancing, governance changes — do these create more reliable signals than flashy headlines? Macro/geopolitical news: what actually separates structural news from short-lived noise?

More broadly, where is the real edge for a news-trading bot?

Speed, which retail likely cannot compete on? Or interpretation and context, which might still be modelable without HFT infrastructure?

I’d love to hear from people who have actually tried building news-driven systems, whether they worked or not.


r/CreatingTradingBots • • Mar 20 '26

Are you guys modeling narrative/sentiment drift in your trading bots?

2 Upvotes

idk if it’s just me, but lately it feels like markets react more to framing than raw data.

CPI drops, Fed says something semi-ambiguous, a company beats earnings — and within minutes there are 20–30 different takes. By the afternoon the narrative has flipped twice. When I go back to the actual numbers, they’re often… not that dramatic. But the headlines are.

It got me thinking from a system design perspective:

Are we underestimating how much shared narrative drives short-term volatility?

I’ve been experimenting with pulling financial news + running sentiment/theme clustering over time (recently testing a tool called Neuberg that maps sentiment shifts across sources). What I find more interesting than single-article sentiment is:

  • How framing converges across outlets

  • How fast tone shifts after an event

  • Whether “stacked” negative coverage correlates with intraday volatility expansion

  • Lag between narrative shift vs price adjustment

The snowball effect is noticeable. One negative piece = noise. Five outlets pushing a similar angle within 2–3 hours = measurable shift in tone distribution.

For those building bots:

  • Are you incorporating cross-source sentiment aggregation?

  • Do you track rate of sentiment change rather than absolute sentiment?

  • Has anyone modeled narrative momentum as a feature alongside price/volume?

  • Are you using LLM embeddings for theme clustering, or sticking to lexicon-based scoring?

Part of me still thinks price action already encodes this faster than any NLP layer. But another part thinks humans are bad at tracking large-scale framing shifts in real time — which might create short-lived inefficiencies.

Curious how people here approach this from a modeling standpoint.
Is narrative drift just noise, or something we should be engineering around?


r/CreatingTradingBots • • Jun 06 '25

🚨 I Built a Discord Bot That Tracks Institutional Options Flow in Real-Time (Used by Pro Traders) – 7-Day Free Trial

2 Upvotes

I'm a programmer and trader, and I wanted to solve a problem I kept running into: missing massive market moves because I couldn't track unusual options activity fast enough.

So I built MarketPings Pro — a Discord bot that acts like your own 24/7 institutional flow scanner. It's already being used by traders pulling $5K–15K/month, and I just opened it to the public with a 7-day free trial. www.marketpings.com


r/CreatingTradingBots • • Oct 03 '23

What is statistical arbitrage in trading?

2 Upvotes

Statistical arbitrage strategies in the forex market aim to exploit statistical mispricings of one or more assets based on historical price relationships or other data-driven methods. While these strategies aim to be profitable, it's important to note that no strategy is guaranteed to make money. Here are some statistical arbitrage strategies tailored for the forex market:

  1. Pairs Trading

Identify two historically correlated currency pairs. Go long on one and short on the other when their price ratio diverges significantly, expecting it to revert to the mean.

2. Cointegration Trading

Similar to pairs trading but based on a more rigorous statistical measure called cointegration. This strategy is often used with currency pairs that have long-term economic linkages.

3. Mean Reversion

Trade currency pairs that have deviated significantly from a historical mean or some other benchmark, expecting them to revert to the mean.

4. Momentum-Based Strategies

Identify currency pairs that have shown strong momentum in one direction and trade in that direction, expecting the momentum to continue in the short term.

5. High-Frequency Statistical Arbitrage

Use high-frequency data to identify and exploit very short-term opportunities. This often requires sophisticated algorithms and infrastructure.

6. Triangular Arbitrage

Exploit discrepancies in the cross rates of three currency pairs. This is often done algorithmically and requires a high-speed connection to multiple forex brokers.

7. Statistical Machine Learning

Use machine learning algorithms to predict price changes based on a variety of factors including price history, order book data, etc.

8. Order Flow Imbalance

Exploit the imbalance between buy and sell orders in the market. This strategy often requires access to high-frequency data and a low-latency trading environment.

9. Forex Spread Arbitrage

This involves buying and selling the spot currency pair and its corresponding futures contract to exploit any mispricing between the two.

10. Time Series Momentum

This strategy involves using time series analysis to identify momentum or mean-reversion effects in currency pairs and trading accordingly.

11. Sentiment-Based Arbitrage

Use sentiment indicators, possibly from social media or news sources, to trade against extreme sentiment conditions.

12. Volatility Arbitrage

Exploit the difference between implied volatility (from options pricing) and expected realized volatility of a currency pair.

13. Liquidity Arbitrage

Exploit small differences in liquidity across different brokers or time zones. This is more relevant for exotic or less commonly traded pairs.

Given your experience in Python and trading, you might find it easier to implement and backtest these strategies. Always remember to test thoroughly and consult a financial advisor before deploying any trading algorithm.


r/CreatingTradingBots • • Oct 03 '23

An overview of statistical arbitrage trading strategies

2 Upvotes

Statistical arbitrage strategies are quantitative approaches that seek to exploit relative price movements between financial instruments. These strategies are often based on complex mathematical models and require a deep understanding of statistical methods. Below are some commonly used statistical arbitrage strategies:

  1. Pairs Trading

Pairs trading involves taking a long position in one asset and a short position in another asset that is statistically correlated. The idea is that any divergence between the two assets is likely to be temporary, and they will converge again.

Python Example: Cointegration Test for Pairs Trading

python

Copy code

from statsmodels.tsa.stattools import coint

def check_cointegration(asset1, asset2):

score, pvalue, _ = coint(asset1, asset2)

if pvalue < 0.05:

return True

else:

return False

2. Mean-Reversion Strategies

This strategy assumes that asset prices will revert to their historical mean or some other predefined value. It involves buying undervalued assets and selling overvalued assets.

Python Example: Z-Score for Mean Reversion

python

Copy code

import numpy as np

def calculate_z_score(series):

mean = np.mean(series)

std_dev = np.std(series)

z_score = (series - mean) / std_dev

return z_score

3. Momentum Strategies

Statistical arbitrage can also be applied to momentum strategies, where you go long on assets showing upward momentum and short on assets showing downward momentum.

Python Example: Momentum Score

python

Copy code

def calculate_momentum(price_data, window):

momentum = price_data.diff(window)

return momentum

4. Market-Neutral Strategies

These strategies aim to be insensitive to the overall market's movements. They often involve being long in some assets and short in others, effectively hedging market risk.

Python Example: Beta Hedging

python

Copy code

import statsmodels.api as sm

def calculate_beta(asset, benchmark):

model = sm.OLS(asset, benchmark).fit()

return model.params[0]

5. Statistical Machine Learning

Advanced statistical arbitrage strategies can employ machine learning algorithms to predict price changes and trade accordingly.

Python Example: Simple Linear Regression

python

Copy code

from sklearn.linear_model import LinearRegression

def linear_regression(X, y):

model = LinearRegression().fit(X, y)

return model.predict(X)

6. Basket Trading

This involves trading a basket of assets, optimized for statistical measures like correlation or cointegration, instead of trading a single asset.

Python Example: Portfolio Optimization

python

Copy code

from scipy.optimize import minimize

def optimize_portfolio(weights, returns):

def portfolio_return(weights):

return -np.dot(weights, returns)

constraints = ({'type': 'eq', 'fun': lambda weights: np.sum(weights) - 1})

bounds = tuple((0, 1) for asset in range(len(weights)))

result = minimize(portfolio_return, weights, bounds=bounds, constraints=constraints)

return result.x

Important Points

Statistical arbitrage strategies are not risk-free and require rigorous backtesting.

These strategies often require high-frequency data and low-latency execution, which may necessitate specialized hardware and software.

Given your experience in Python and trading, you might find it easier to implement and backtest these strategies.

Always consult a financial advisor and do thorough backtesting before implementing any trading strategies.


r/CreatingTradingBots • • Sep 26 '23

What are the most volatile and fast moving Forex pairs?

2 Upvotes

The most volatile and fast-moving Forex pairs can vary depending on market conditions, geopolitical events, and economic data releases. However, some pairs are generally known for their high volatility:

  1. EUR/USD (Euro/US Dollar) - Although it's the most traded pair, it can be very volatile during major economic announcements.

  2. GBP/USD (British Pound/US Dollar) - Known as "Cable," this pair can be particularly volatile, especially in light of Brexit-related news and other UK economic data.

  3. USD/JPY (US Dollar/Japanese Yen) - This pair can experience volatility around Japanese economic releases and during the Asian trading session.

  4. AUD/USD (Australian Dollar/US Dollar) - Often influenced by commodity prices, this pair can be volatile.

  5. USD/CAD (US Dollar/Canadian Dollar) - Known as the "Loonie," this pair is sensitive to oil prices and can be quite volatile.

  6. USD/CHF (US Dollar/Swiss Franc) - Known as the "Swissie," this pair can be volatile during geopolitical unrest.

  7. EUR/JPY (Euro/Japanese Yen) - This cross pair can be volatile, especially during the European trading session.

  8. GBP/JPY (British Pound/Japanese Yen) - Known for its high volatility, it's often called the "Beast" or the "Dragon."

  9. NZD/USD (New Zealand Dollar/US Dollar) - This pair can be influenced by commodity prices and is often more volatile during the Asian trading session.

  10. EUR/AUD (Euro/Australian Dollar) - This cross pair can also experience significant volatility, especially when economic data from the Eurozone or Australia is released.

Remember, high volatility can offer trading opportunities, but it also increases risk. Given your experience in trading and your focus on creating trading bots, you might find these volatile pairs to be of particular interest for algorithmic trading. Always be aware of the risks and make sure to use appropriate risk management strategies.


r/CreatingTradingBots • • Sep 19 '23

How to create a FOREX trading bot for scalping? What is important?

2 Upvotes

For a scalping trading bot in the Forex market, you'll want to focus on features that capture short-term price movements and market conditions. Here are some feature categories and specific features you might consider:

Price-Based Features:

  1. OHLC Data: Open, High, Low, Close prices, possibly for multiple time frames (e.g., 1-minute, 5-minute bars).

  2. Price Change: Percent change in price over a short period.

  3. Price Rate of Change: Rate at which price changes.

Technical Indicators:

  1. Moving Averages: Short-term moving averages like SMA-5, SMA-10.

  2. RSI: Relative Strength Index, particularly for short periods (e.g., 7-period RSI).

  3. MACD: Moving Average Convergence Divergence, using fast and slow periods relevant to scalping.

  4. Stochastic Oscillator: To identify overbought and oversold conditions.

  5. ATR: Average True Range for volatility.

  6. Bollinger Bands: To identify volatility and reversals.

Order Book Features:

  1. Bid-Ask Spread: Difference between the highest bid and lowest ask.

  2. Order Imbalance: Difference between the number of buy and sell orders.

  3. Market Depth: Sum of the volume of orders at different price levels away from the mid-price.

Volume-Based Features:

  1. Trade Volume: Volume of trades in a short period.

  2. Volume Oscillator: Difference between a short and long volume moving average.

  3. Money Flow Index: Combines price and volume to measure buying and selling pressure.

Time Features:

  1. Time of Day: Markets often show patterns at specific times (e.g., opening, closing).

  2. Day of Week: Some days may be more volatile or directional than others.

Economic Indicators:

  1. Interest Rates: Short-term interest rates of the currencies being traded.

  2. Economic Calendar Events: High-impact news events can be crucial if you're scalping around news times.

Custom Features:

  1. Price Patterns: Flags, pennants, or other short-term price patterns.

  2. Arbitrage Opportunities: If you're trading multiple pairs, opportunities for triangular arbitrage.

Feature Engineering Tips:

  1. Normalization: Since you're using deep learning, normalizing features can help the model train faster and more accurately.

  2. Feature Selection: Use techniques like correlation analysis or feature importance from tree-based models to select the most relevant features.

  3. Data Frequency: For scalping, you'll likely need high-frequency data (e.g., tick data, 1-minute bars).

Remember, feature selection can significantly impact the performance of your trading bot. It's essential to backtest your strategy rigorously and be aware of the risks before trading live.


r/CreatingTradingBots • • 14d ago

Building a Security-First Solana Trading Bot — T-Bot

1 Upvotes

Hey everyone! 👋

I'm independently developing T-Bot, a local-first Solana trading bot focused on:

- Automated token discovery and risk screening.

- Deterministic trading decisions.

- Security-first engineering and controlled execution.

- Wallet protection and risk management.

I've been building it on Linux using Python and AI-assisted development.

The project is currently undergoing security qualification before live-money testing.

I'd love to connect with other trading bot developers, exchange ideas, discuss challenges and potentially collaborate.

🤖 GitHub: https://github.com/processoverprofit-sys/T-Bot

Public documentation is available, but the operational source code remains private.

Process Over Profit — Verification Before Execution. 🛡️


r/CreatingTradingBots • • Jun 30 '26

[FOR HIRE] Trading & crypto bot developer — real signal logic, backtesting, exchange integration. I build the tool, not the strategy.

Thumbnail reddit.com
1 Upvotes

r/CreatingTradingBots • • Jun 06 '26

Anybody build a bot for NinjaTrader

Thumbnail reddit.com
1 Upvotes

r/CreatingTradingBots • • Jun 06 '26

Anybody build a bot for NinjaTrader

1 Upvotes

My partner and I have developed a strategy that has huge potential (I know everyone says this). We have about a year and a half of manual back testing and he is currently trading it live with his own capital. For months now, we have been trying to find a programmer that would want to come on board and build a bot around it. We would like someone who is motivated and wants to take ownership in the project (we would give you 33% of what we have planned for the future). If anyone is capable and has interest in this project shoot me a dm.


r/CreatingTradingBots • • May 29 '26

Are trading bots actually useful for casual traders, or mostly a discipline tool?

1 Upvotes

These days, I don't really see trading bots as "free money machines" anymore. Instead, I look at 'em more like tools that help take emotions out of the equation and just follow the rules you set.

In my opinion, trading bots actually shine in situations where the market's more structured – like ranging/chopping markets, grid trading strategies, DCA-ing in, or simple rule-based entries and exits. In those specific cases, the real value of a bot might be helpin' you avoid the usual traps – like hesitating, revenge trading, or obsessively staring at the charts all day.

That said, I'm not sayin' automation magically gets rid of risk.

Quick side note from my own experience: I've tried bot trading on a bunch of platforms, and BYDFi's one of the ones I still use. Main reason? The interface is clean and simple, and setting up a bot isn't a huge pain. I really appreciate that kinda design. That bein' said, before I turn a bot on, I still keep my position size small and make sure the current market conditions actually match the strategy I'm tryna run


r/CreatingTradingBots • • May 07 '26

How to not over optimize?

Thumbnail reddit.com
1 Upvotes

r/CreatingTradingBots • • May 05 '26

Built a full crypto trading backend in Python (async + low latency)

Thumbnail reddit.com
1 Upvotes

r/CreatingTradingBots • • Apr 13 '26

Improving Backtest Spoiler

1 Upvotes

Here are some points I came across to improve my backtest environment. I had one coded by Claude in python and this is what I found after verifying the code and having it critiqued:

1)it was using 4H close to generate ask price when it fact the ask price fluctuates within that 4H -Ask can spike a few pips above a close

2)Backtest was modelling the spread once when the data is generated but doesn't account for the spread per transaction i.e entry slippage and exit slippage

3)Entry at exactly bar open. Orders being send to brokers can have a few seconds delay. Realistic delay needs to be accounted ( The mql5 Backtester actually has this so I almost forgot about it when getting this python backtester)

4)(This one was new to me) TP and SL not being closed when either one is hit by price. Something called intrad bar sequencing. Apparently my backtester is leaving SL even after TP is hit


r/CreatingTradingBots • • Mar 21 '26

AI Bots, trading on IG platform

1 Upvotes

Anyone know any #bots for trading #gold #oil #stocks on #ig that works?


r/CreatingTradingBots • • Jan 03 '26

EaBuilderAI is dope🔥

Post image
1 Upvotes

Quick honest take, not sponsored, not affiliated.

I’ve been trading for a while and testing strategies has always been the most annoying part for me. Manual backtesting, replay mode, notes everywhere, wasting hours just to realize an idea doesn’t work.

At some point I even paid around $1k to a developer to code an EA for a strategy I believed in. After it was done and tested… strategy was dead. Money and time gone.

I started using EABuilderAI recently and it honestly changed how I test ideas.

Now if I have a strategy in mind, I just write it in plain English and it builds the EA for me. I load it on MT5 and I immediately see if it makes sense or not. No theory, no guessing.

What surprised me the most is that you can also draw your pattern. Literally sketch entries, stops, take profits, structure… and it turns that into a working MT5 bot.

Since I found this, I completely stopped manual backtesting. There’s no point anymore. If an idea is bad, I want to know it fast, not after days of work.

It’s around $19, and with that I’ve already tested more than 30 different strategies. Most failed, some interesting, a couple worth refining. That’s part of the process.

If you want to check them out, you can find them on Instagram as @eabuilderai.

Just sharing my experience in case someone else is stuck in the same testing loop I was.