Nexus II - A Python coded AI that advises and a system that decides.

dap711

Active member
VIP
Introduction to Nexus II

You are required to have Schwab API access to run the system. Without access, the system is useless.
This is a beta version of the code and currently only trades paper. It will NOT take real trades (yet)

Nexus II is a deterministic, contract-driven trading system augmented by a self-learning AI advisory layer, built for operators who demand clarity, control, and auditability in live market environments.

It is not a signal toy, a black-box AI, or a one-click trading bot.

Nexus II is a decision engine—one that combines disciplined rule-based execution with adaptive intelligence, while preserving explicit state, strict risk control, and full traceability.


Why Nexus II Exists

Most trading systems fail for predictable reasons:
  • []State is implicit instead of explicit []Restarts create duplicates []Risk rules are scattered or bypassed []Static trade parameters mutate over time []Machine-learning models leak future information []“AI decisions” cannot be explained after the fact
Nexus II was designed to eliminate these failure modes without abandoning learning or adaptation. The system enforces hard contracts around execution and risk, while allowing a self-learning AI to observe, evaluate, and improve decisions over time—without ever directly bypassing system controls.


The Role of the Self-Learning AI

AI as an Advisor, Not an Executor
The self-learning AI in Nexus II does not place trades and does not mutate the ledger. Instead, it operates in an advisory capacity, providing:
  • []Signal confidence scoring []Regime classification (trend vs chop, volatility state, liquidity state) []Override recommendations (strengthen, weaken, or abstain) []Post-trade outcome analysis
The final authority always remains with the deterministic system gates.


Learning From Reality, Not Backtests

The AI learns from:
  • []Actual executed trades []Actual fills and slippage []Actual exits and outcomes []Actual regime conditions
It does not train on hypothetical futures or backfilled labels that would be unavailable in real time. This ensures learning is grounded in real operational data, not simulation artifacts.


Hard Separation: Learning vs Acting

Nexus II enforces a strict firewall:
  • []Static trade data is immutable []Ledger records are append-only []AI outputs are recommendations only []Execution logic remains deterministic
The AI may recommend:
  • []“Do nothing” []“Reduce size” []“Require higher confirmation” []“Skip in this regime”
But it may never override:
  • []Risk rails []Capital constraints []Deduplication rules []Trade lifecycle state


Online Learning With Guardrails

The AI learns continuously in shadow mode:
  • []Evaluating what would have happened []Comparing outcomes against baseline logic []Tracking confidence calibration []Measuring stability over time
Only after sustained, measurable improvement—and only when explicitly enabled—may AI influence execution gates, and even then:
  • []Changes are reversible []Rollback triggers are enforced
  • All AI-influenced decisions are logged
There are no silent promotions from experiment to production.


What Nexus II Is (and Is Not)

Nexus II Is

  • []A ledger-first trading system []A state-aware execution engine []A learning-augmented decision framework []A platform where AI improves judgment, not authority
Nexus II Is Not
  • []An autonomous AI trader []A self-modifying codebase []A system that “learns live” without safeguards []A model that cannot explain itself


Core Operating Philosophy

1. The Ledger Is Truth
All positions, P/L, and capital usage originate from a single authoritative ledger. The AI observes the ledger—it does not alter it.



2. YAML Is the Single Source of Truth All system behavior—risk, sizing, feature flags, and AI enablement—is controlled via configuration, not code.



3. Static vs Dynamic Data Is Sacred The AI may analyze static trade parameters and dynamic market data, but it may never rewrite history.



4. Determinism Before Intelligence Learning enhances the system only where determinism is already correct. If the system cannot safely explain or gate an AI recommendation, it is ignored.



5. Explicit Trade Lifecycle

Preview → Armed → Open → Closed The AI may advise at any stage—but it never skips one.


Who Nexus II Is For

Nexus II is designed for:
  • []Traders who want adaptive intelligence without surrendering control []Quants who demand clean learning boundaries []Developers building long-lived automated systems []Operators who need to explain why a trade happened weeks later


A Final Note on Learning

Nexus II does not chase intelligence for its own sake. The self-learning AI exists to:
  • []Reduce overtrading []Avoid bad regimes []Improve consistency []Enforce humility when confidence is low

In uncertain markets, Nexus II ensures the system learns—without forgetting discipline.
 

Attachments

  • Nexus II.zip
    440.4 KB · Views: 18
Last edited by a moderator:
Found a bug in riskrails.py File is attached. Rename it form riskrails.py.txt to riskrails.py and drop in the "infra" folder.

1765810334591.png
 

Attachments

  • riskrails.py.txt
    11.7 KB · Views: 3

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thread starter Similar threads Forum Replies Date
A Migration Script from ToS to Python or JavaScript Playground 1

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
564 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top