TRADESTACK / PYTHON RESEARCH ENGINE

Engineering behind
every trading decision.

Understand how TradeStack converts streaming market data into candidate signals, applies strategy and risk rules, simulates fills and records a position's complete lifecycle.

PYTHON + FASTAPIRULE-BASED11 STRATEGY CLASSESPAPER MODE
01 / EXECUTION PIPELINE

From first tick
to recorded outcome.

A simplified overview of the Python service. Every stage has a purpose; a candidate signal does not automatically become a trade.

01 / MARKET INPUT

Upstox V3 WebSocket

Index and option ticks, market depth and available option-chain context.

02 / CONTEXT

Analyze market structure

1-minute candles, VWAP, EMA, ADX, RSI and 5/15-minute trend context.

03 / STRATEGY

Generate candidate

Pattern and trend setups propose CALL, PUT or neutral outcomes.

04 / FILTER + SCORE

Approve or reject

Time, trend, volatility, exhaustion, confirmation and scoring rules.

05 / RISK + PAPER FILL

Simulated position

Session limits, sizing, spread/depth checks, entry and exit management.

06 / JOURNAL

Review and replay

Trades, signals, exit context, fee estimates and recorded market events.

This is a conceptual flow of code paths, not a live status monitor. Live broker execution is not available through the current public gateway.
02 / STRATEGY LIBRARY

Multiple setups.
One evaluation framework.

The engine README documents 11 strategy classes and a range of named setups. Some strategies and flags can be disabled; nothing here claims each one is currently profitable.

01

Momentum and trend

Study directional moves, pullback confirmations and continuation opportunities using market structure and moving averages.

IMPULSE_SCALPTREND_PULLBACKTREND_CONTINUATIONMOMENTUM_ENTRYEMA_RETEST
02

Level and reference bounces

Evaluate reactions around central pivot range, VWAP and nearby price levels under higher-timeframe checks.

CPR_BOUNCEVWAP_BOUNCE
03

Breakout and expansion

Investigate inside-bar breaks, retests and compression-driven expansion with confirmation rules.

INSIDE_BAR_BREAKOUTBREAKOUT_RETESTCOMPRESSION_BREAKOUT
04

Reversal formations

Detect potential trend shifts and formation-based reversals while checking directional context and counter-trend risk.

ST_REVERSALDOJI_TOP_REVERSALDOJI_BOTTOM_REVERSALDOUBLE_TOPDOUBLE_BOTTOMHS_TOPHS_BOTTOM

Names reflect the engine's documented strategy taxonomy. Additional conditional candidates and feature flags are discussed in code. Available configurations may enable or suppress specific setups.

03 / SIGNAL VALIDATION

A signal is only
the beginning.

TradeStack's analytical code includes staged post-signal checks and a scoring threshold. The gate shown below is illustrative; it does not evaluate actual market conditions.

01

Session and feature gates

Allowed time windows and flags for specific setups.

02

Market alignment

VWAP, Dow bias, 5/15-minute trends, ADX and counter-trend protection.

03

Quality and overextension

Candle strength, exhaustion, Z-score/ALMA distance and regime context.

04

Signal score and risk

Documented minimum signal score of 7, followed by independent capital and execution checks.

SIGNAL REVIEW / ILLUSTRATIONNOT LIVE
Candidate decision review
Market contextREQUIRED
Strategy evaluationREQUIRED
Signal filtersREQUIRED
Minimum scoring gate7 · CONFIGURED
Risk permissionSEPARATE CHECK
Only evaluated candidates can progress to simulated execution.
04 / POSITION PROTECTION

Built to define risk.
Not eliminate it.

The code includes controls for capital exposure and active trade management. These are software mechanisms, not guarantees against loss or slippage.

01 / SESSION

Daily drawdown lock

Redis-backed risk state can block new entries after a configured daily-loss boundary. The gateway default specifies 5% of configured capital.

02 / ENTRY

Capital & liquidity checks

Position-sizing calculations and option-spread/depth conditions are considered before simulated execution.

03 / POSITION

Stop and profit management

The lifecycle component contains initial stop, break-even, partial milestone, trailing and target-state logic.

04 / RESILIENCE

Missing price protection

The risk engine includes a block for unresolved exit pricing, keeping new entries restricted until reconciliation.

Configuration values and enforcement differ by component and strategy version. The website does not claim the previously discussed “two-loss guard” is verified across all paths; that requires a separate runtime audit.
05 / TRADE LIFECYCLE

What happens
after a paper entry?

The trade context tracks index-based stop/target levels while preserving option fill and P&L details. A trade is monitored until an exit reason is recorded.

ENTRY

Start position

Simulated order context and entry conditions are recorded.

PROTECT

Move stop

Configured break-even and profit-lock milestones may adjust index-based protection.

FOLLOW

Trail or exit

Trailing, stop, target and adverse momentum behavior are evaluated by the position logic.

REVIEW

Close and audit

Exit reason, fill data and estimated fees become part of the recorded trade history.

Exit reasons and P&L attribution must be reconciled against the actual data. Labels such as PROFIT_LOCK and BREAK_EVEN should not be taken as proof of a profitable close without the recorded prices and fees.
06 / REPLAY ENGINE

Replay the inputs.
Question the outcome.

The engine records tick and depth streams into date-partitioned Parquet data. Replay uses a simulation clock and a depth-aware fill model to inspect historical behavior.

01

Capture

Asynchronous market-data recording and session manifests.

02

Synchronize

Use a simulated clock instead of mixing live wall time into historical events.

03

Model fills

Evaluate order-book depth, timing and estimated transaction charges.

04

Validate

Check gaps, completeness and differences between replay and paper behavior.