Explore more topics
AI trading workflows

Paper trade with Claude Code

Create a SPY paper portfolio with Claude Code, review simulated orders and follow its history in NexusTrade.

Jump to a section

TL;DR

Preview the SPY rules, create a separate paper portfolio, review its proposed orders and follow its recorded history. The original example passed strategy validation on October 10, 2026; it has no recorded forward paper run.

1. Preview the SPY rules

Exact SPY entry, ten-share sizing and full-position exit
This diagram shows the exact strategy configuration validated on October 10, 2026.
Inspect the request

Connect Claude Code, then preview the exact SPY strategy. The request stops for your rule review.

2. Create your paper portfolio

Save the reviewed rules as a new draft, then approve a separate paper deployment. Keep the running paper portfolio's ID for the steps below.

Prompt
Use the SPY configuration I just reviewed. Save it as a new chat draft named SPY 200-day trend and read it back. Show the draft ID, $10,000 starting balance and both rules. After I approve paper deployment, deploy that new chat draft as a separate paper portfolio. Find and read back the resulting paper portfolio, verify its type and keep its running ID separately. Stop if the target is an existing live portfolio.

3. Check evaluation and review an order

Paper Trading and Automated Trading controls in NexusTrade's Deployment Center
This example shows the current paper controls. Inspect your own saved portfolio after activation.

Open the verified running paper portfolio in NexusTrade and inspect its Deployment Center. The Automated Trading switch controls strategy evaluation: if you choose to change it, select Save Changes and read the same portfolio again. Confirm isActive and record the actual deployment frequency. This control is separate from the live-only Autonomous Trading approval policy; paper portfolios remain on manual order review.

When a signal creates a pending simulated order, open Order Management, select Paper and Needs Review, and compare its portfolio, symbol, side and size with the frozen rules before choosing Confirm. Check the resulting order state and paper history. A pending approval is not a filled trade. An empty history can mean no qualifying signal or an unapproved order; it does not justify another deployment.

4. Read the paper history

Use the running paper portfolio ID to read its dated values. Follow all pages for your observation window. A new portfolio can have no fills while it waits for a qualifying signal or order approval.

JSON
{
  "portfolio_id": "<verified-running-paper-id>",
  "page": 1,
  "page_size": 500
}

5. Pause the paper portfolio

Review the pause request below with the running paper ID. Read it back afterward and check type:paper and isActive:false. Pausing evaluation keeps holdings and history; review outstanding simulated orders separately.

JSON
{
  "operations": [
    {
      "type": "undeploy",
      "portfolioId": "<verified-running-paper-id>"
    }
  ]
}
Open exact configuration and tool reference

Set the observation window

Record the start date, simulated starting capital and strategy version before activation. Decide when you will review activity and which condition would make you pause the test. Keep rule changes and cash changes in the log so you can explain the deployed curve.

Keep draft and deployment identities separate

SDK save writes a draft; deploy creates the running paper portfolio and returns deployment.portfolioId. Those identifiers coexist. The MCP chat deployment path also creates a separate paper book. Use the running book’s ID for history and monitoring.

Inspect the returned deployment type rather than relying on a portfolio name containing the word paper.

Create and monitor a separate paper deployment

  1. Preview the candidate

    NexusTrade tool

    build_portfolio

    Identity boundary

    Review the canonical configuration and fix validation issues before saving

  2. Author the candidate

    NexusTrade tool

    create_portfolio

    Identity boundary

    A newly authored chat portfolio, not an existing live account

  3. Inspect the target

    NexusTrade tool

    get_portfolio

    Identity boundary

    Read the exact returned ID and strategies before activation

  4. Deploy the chat book

    NexusTrade tool

    update_portfolio

    Identity boundary

    operations: [{type: "deploy", portfolioId: returnedChatId}] creates paper

  5. Find the running book

    NexusTrade tool

    fetch_portfolios

    Identity boundary

    Keep the resulting deployment ID separately from the original chat/draft ID

  6. Read actual paper history

    NexusTrade tool

    query_portfolio_history

    Identity boundary

    The deployed portfolio curve; never substitute a backtest curve

Show the table · 6 rows, 3 columns

Scroll sideways to compare all columns. Select a heading to sort.

Preview the candidatebuild_portfolioReview the canonical configuration and fix validation issues before saving
Author the candidatecreate_portfolioA newly authored chat portfolio, not an existing live account
Inspect the targetget_portfolioRead the exact returned ID and strategies before activation
Deploy the chat bookupdate_portfoliooperations: [{type: "deploy", portfolioId: returnedChatId}] creates paper
Find the running bookfetch_portfoliosKeep the resulting deployment ID separately from the original chat/draft ID
Read actual paper historyquery_portfolio_historyThe deployed portfolio curve; never substitute a backtest curve

Deploying an existing live portfolio ID can reactivate real brokerage trading. For this workflow use the newly authored chat candidate and verify the returned deployment is paper. The SDK also separates saved draft IDs from deployment.portfolioId.

Exact validation request and provenance

On October 10, 2026, we built this complete SPY candidate with the NexusTrade Python SDK and sent it to build_portfolio. The product returned valid: true, no issues, and the two canonical rules shown below. The entry buys 10 shares, with a zero-position guard; the exit closes the current holding only when price is strictly below its 200-day average. Equality triggers neither rule.

Copy this complete request into build_portfolio to inspect the same candidate. The preview saved nothing and started no historical test or paper deployment. Use the client steps below to create and observe your own paper draft.

Both returned rules have automaticOrderApproval: false. Keep the saved draft ID, accepted backtest ID and running paper ID in separate fields. The configuration's Day indicator window does not set the deployed book's evaluation schedule.

Show the table · 6 rows, 2 columns
Product responseObserved value
Validationvalid: true; issues: []
CapitalinitialValue: 10000
EntryBuy 10 shares of SPY whenever SPY's price is above its 200-day average price and the portfolio holds no SPY.
ExitSell 100% of the current SPY position whenever SPY's price is below its 200-day average price and the portfolio holds SPY.
Order approvalautomaticOrderApproval: false on both returned rules
PersistenceNothing was saved
JSON
{
  "name": "SPY 200-day trend",
  "initialValue": 10000,
  "cash": 10000,
  "buyingPower": 10000,
  "strategies": [
    {
      "name": "Guarded ten-share entry",
      "condition": {
        "type": "And",
        "conditions": [
          {
            "type": "Base",
            "lhs": {
              "type": "Price",
              "targetAsset": {
                "type": "Stock",
                "symbol": "SPY",
                "name": "SPY"
              }
            },
            "comparison": "greaterThan",
            "rhs": {
              "type": "SimpleMovingAverage",
              "targetAsset": {
                "type": "Stock",
                "symbol": "SPY",
                "name": "SPY"
              },
              "window": {
                "length": 200,
                "interval": "Day"
              }
            }
          },
          {
            "type": "Base",
            "lhs": {
              "type": "PositionValue",
              "targetAssets": [
                {
                  "type": "Stock",
                  "symbol": "SPY",
                  "name": "SPY"
                }
              ]
            },
            "comparison": "equal",
            "rhs": {
              "type": "Value",
              "value": 0
            }
          }
        ]
      },
      "action": {
        "type": "Buy",
        "targetAsset": {
          "type": "Stock",
          "symbol": "SPY",
          "name": "SPY"
        },
        "amount": {
          "type": "number of assets",
          "amount": 10
        }
      },
      "orderExecution": {
        "type": "Market"
      }
    },
    {
      "name": "Close below average",
      "condition": {
        "type": "And",
        "conditions": [
          {
            "type": "Base",
            "lhs": {
              "type": "Price",
              "targetAsset": {
                "type": "Stock",
                "symbol": "SPY",
                "name": "SPY"
              }
            },
            "comparison": "lessThan",
            "rhs": {
              "type": "SimpleMovingAverage",
              "targetAsset": {
                "type": "Stock",
                "symbol": "SPY",
                "name": "SPY"
              },
              "window": {
                "length": 200,
                "interval": "Day"
              }
            }
          },
          {
            "type": "Base",
            "lhs": {
              "type": "PositionValue",
              "targetAssets": [
                {
                  "type": "Stock",
                  "symbol": "SPY",
                  "name": "SPY"
                }
              ]
            },
            "comparison": "greaterThan",
            "rhs": {
              "type": "Value",
              "value": 0
            }
          }
        ]
      },
      "action": {
        "type": "Sell",
        "targetAsset": {
          "type": "Stock",
          "symbol": "SPY",
          "name": "SPY"
        },
        "amount": {
          "type": "percent of current positions",
          "amount": 100
        }
      },
      "orderExecution": {
        "type": "Market"
      }
    }
  ],
  "supportsFractionalShares": false,
  "supportsCrypto": false,
  "alertsEnabled": false,
  "dividendPolicy": "cash"
}

Validated example: SPY SMA200

NexusTrade validation recorded October 10, 2026 returned valid:true with no issues. This preview saved nothing and has no forward Paper history.

Starting capital
$10,000
  1. Entry

    Buy 10 shares of SPY whenever SPY's price is above its 200-day average price and the portfolio holds no SPY.

  2. Exit

    Sell 100% of the current SPY position whenever SPY's price is below its 200-day average price and the portfolio holds SPY.

  3. Rule decision example

    Hypothetical: SPY at $110, its 200-day average at $100, and no SPY held. The entry proposes buying 10 shares. An existing holding blocks another entry.

  4. Exit and equality

    At price equal to the average, neither entry nor exit passes. Below the average with a holding, the exit proposes selling the entire position.

Continue exploring

Discussion

Sign in or create a free account to join the discussion.

No comments yet.

Aurora · AI research assistant

Try this in Aurora

Edit the request, then open it in Aurora. You choose when to send it.