1. Choose a ChatGPT connection that supports this task
On ChatGPT web, an authorized account creates the app under Settings > Apps > Create, or Workspace settings > Apps > Create for an admin. Provide the endpoint below, select OAuth, Scan Tools, finish authorization and Create. In a new ordinary chat, select NexusTrade from the tools menu or mention the app again for each message that needs a fresh tool call.
Pro custom MCP is read/fetch only. Backtest submission, candidate creation and paper activation require write-capable Business or Enterprise/Edu app access and enabled actions. Agent mode does not use custom apps; deep research uses them for read/fetch only. If Create is missing, check workspace permissions instead of pasting local configuration into the web chat.
Hosted MCP endpoint
https://nexustrade.io/api/mcpDesktop and plugins use different connections
If an integration is available under Plugins, open its details, install with the plus button, authenticate when requested and start a new chat. Do not assume NexusTrade is listed. The desktop MCP settings configure local Codex tasks: Settings > MCP servers > Add server, name nexustrade, Streamable HTTP, the endpoint above, Save > Restart > Authenticate. Confirm it with /mcp in that local task. Web chats do not read this host configuration.
2. Check the returned account tools
The result is a paginated object with portfolios, total and totalPages. Walk pages when necessary. A new account may return an empty list. Keep authentication errors and missing results separate. Do not infer a successful connection from a tool list alone.
Use fetch_portfolios with the JSON below. Read a portfolioId returned by that call with get_portfolio, setting its portfolio_id argument to the same value. Compare the name, type and strategies with the intended NexusTrade account. If no portfolio exists, keep the empty result and continue to the new draft preview below. Do not create anything during this check.
{
"include_paper": true,
"include_live": false,
"include_chat_portfolios": true,
"include_positions": false,
"limit": 20,
"page": 1
}Confirm permission for this task
Discover build_portfolio, create_portfolio, get_portfolio and backtest_portfolio, query_backtest_status and query_backtest_history in the current connection. Check that the granted app actions allow this task before submitting anything. A plugin listing or successful read does not grant write access. On ChatGPT web, Pro custom MCP is read/fetch only; use authorized Business or Enterprise/Edu write actions for these steps.
3. Freeze this proposed rule before submitting anything
This teaching example uses SPY only, no leverage and a $10,000 starting balance. At each daily evaluation, compare Price with its 200-period SimpleMovingAverage using a Day window. Target 25% of portfolio value in SPY when price is above the average, 0% when below it, and keep the prior target at equality. Leave the rest in cash. Review the returned strategy JSON for these rules and for repeated-buy protection.
Use 2021-01-01 through 2024-12-31 for the first historical window. Keep 2025-01-01 through 2025-12-31 unopened until the exact rule and evaluation criteria are frozen. The dates and allocation are proposed inputs, not a performance result. Choosing after seeing that period would make it retrospective validation and would no longer test an unseen period.
4. Author and read back a new candidate
Use structured strategy objects after reviewing them. Read condition/action fields rather than relying on a strategy name. Saving the chat candidate does not activate a paper or brokerage portfolio.
Read get_portfolio structured output under portfolio: portfolioId, type, isActive, strategies, initialValue and deployment. Resolve a mismatch before using that ID in another operation.
Draft a NEW chat portfolio named SPY SMA200 25pct v1 with initialValue 10000 and dividendPolicy reinvest. Author two explicit strategies for the daily SPY Price versus 200-Day SimpleMovingAverage target rule above, capped at 25% long exposure with remaining cash. Show complete condition and action objects, sizing, evaluation schedule and orderExecution before saving. Call build_portfolio with the full structured draft first. Inspect valid, the canonical portfolio and every reported issue. Fix issues and repeat the preview; it does not persist a candidate. After I approve the definition, use create_portfolio structured name, initialValue, dividendPolicy and strategies fields. Read the returned chat portfolio with get_portfolio using its actual portfolio_id. Retain the SPY experiment definition and returned operation IDs in a saved note. Stop after saving; do not backtest or deploy yet.5. Review the inputs, then submit one backtest
Replace the ID placeholder with the exact candidate ID returned by your account. Review this backtest_portfolio argument object before approving submission. Zero stock commissions are an explicit teaching assumption, not a claim about brokerage costs. Change the fee contract if your experiment needs commissions.
Record indicator warmup and signal/fill timing from the returned rules and engine behavior. A daily test does not establish intraday fills, spread/slippage, liquidity or brokerage availability. Reinvestment makes the dividend assumption explicit for the benchmark comparison.
{
"portfolio_id": "REPLACE_WITH_RETURNED_CHAT_ID",
"start_date": "2021-01-01",
"end_date": "2024-12-31",
"interval": "Day",
"initial_value": 10000,
"baseline_symbol": "SPY",
"generate_events": false,
"dividend_policy": "reinvest",
"fee_config": {
"Stock": {
"amount": 0,
"type": "dollars"
}
}
}6. Recover the accepted job and inspect its history
Record the accepted backtest ID from the returned response text with its status and interval. A structured backtest_id field is not guaranteed. Call query_backtest_status with {"backtest_id": the returned ID}. PENDING or RUNNING means keep that ID and poll it. ERROR needs the reported failure resolved. Read completed statistics and warnings, then query_backtest_history with the same backtest_id, page:1 and page_size:500; continue pages for the chosen period.
If a response is interrupted after submission, recover the accepted job from the account or recorded operation before considering another submission. Do not launch a duplicate because the history is empty while the job runs. Preserve returned IDs in the experiment record.
| value and comparisonValue | Candidate and benchmark share the same dates/capital |
| cash and positionValue | Exposure stays within the saved rule |
| reservedCollateral | Null means unrecorded, not zero |
| Status and warnings | Only report completed data, with failures/missing coverage retained |
No matching rows. Clear the filter to see all records.
7. Run the frozen unseen window once
After reviewing and freezing the candidate, submit a separate backtest with the same saved rule, capital, Day interval, benchmark and cost/dividend assumptions, changing only dates to 2025-01-01 and 2025-12-31. Retain both IDs. Inspect drawdown, exposure, activity, missing data and benchmark history before comparing returns. Editing after reading this window creates a new candidate that needs another genuinely unseen evaluation.
The tool sequence
Inspect the discovered inputs before submitting a call. For a new candidate, validate and save it first; for a saved candidate, start with get_portfolio. Record the portfolio and backtest identifiers returned by the account tools.
| Validate a new candidate | build_portfolio | Canonical configuration and component issues; nothing is saved |
| Save the validated draft | create_portfolio | Use the reviewed configuration and retain the returned chat portfolio ID |
| Read the saved book | get_portfolio | Exact strategies, action sizing, and portfolio identity |
| Submit the historical test | backtest_portfolio | Explicit dates, interval, capital and benchmark |
| Poll the same operation | query_backtest_status | Terminal state and warnings; do not resubmit while running |
| Inspect the curve | query_backtest_history | Historical values for the returned backtest_id |
| Compare candidates | compare_backtests | Identical period and assumptions, with activity and risk |
No matching rows. Clear the filter to see all records.