Build your first AI trader
You don't need to be a quant or a programmer. If you can describe a trading idea in plain English, an AI assistant can write the code, and ApesTogether gives it a public, timestamped record against the S&P 500, with no money of your own at risk.
1. What you're building
A small program that runs once a day, decides whether to buy or sell, and sends that order to your ApesTogether portfolio. ApesTogether fills it at a live market price (or at the next open if the market is closed) and adds it to your public record. If your record holds up, people can subscribe for $9/month to follow it, and you keep 85% after app-store fees, paid per subscriber. No account size or assets under management required. Subscribers tend to go where the records are strongest, so plenty of traders earn little or nothing.
2. Pick one simple idea
Start with something you can say in one sentence. A few to try:
- Trend: "Hold SPY when it's above its 200-day average; otherwise hold cash."
- Momentum: "Once a month, own the 5 stocks from my list that went up the most over the last 6 months."
- Your own rules: ask your AI, "Interview me with 5 questions about how I'd pick stocks, then turn my answers into exact buy and sell rules."
Simple beats clever. Fewer trades, clear rules, and something you'd actually stick with.
3. Let an AI write the code
Paste this into ChatGPT, Claude or Gemini and replace the bracketed part with your idea:
I want to build a simple stock-trading bot in Python that paper-trades on ApesTogether. My rule: [describe your idea in plain words]. - Use the yfinance library for price history. - Use the ApesTogether Trader API (docs: https://apestogether.ai/developers). Read my key from the environment variable APESTOGETHER_KEY and send it as "Authorization: Bearer <key>". - Get my holdings with GET /api/v1/positions. - Place market orders with POST /api/v1/orders using symbol, side and qty. Never send a price. ApesTogether sets it. - Always set client_order_id to something unique per day so a retry can't trade twice, and start with "dry_run": true. - Explain each step simply, and tell me how to run it once a day on Windows or Mac.
4. A starter bot you can run today
This one follows the trend idea above. It's a textbook rule picked to show the mechanics, not a recommendation. Install Python, then pip install requests yfinance, save this as bot.py, set your key (APESTOGETHER_KEY) and run python bot.py.
"""Hold SPY when it's above its 200-day average, otherwise hold cash.
Paper trading on ApesTogether. Runs once a day."""
import os, requests, yfinance as yf
API = "https://apestogether.ai/api/v1"
H = {"Authorization": f"Bearer {os.environ['APESTOGETHER_KEY']}"}
DRY_RUN = True # flip to False once you like what it would do
SYMBOL, BUDGET = "SPY", 1000 # dollars to put to work
closes = yf.Ticker(SYMBOL).history(period="1y")["Close"]
price, avg200 = closes.iloc[-1], closes.tail(200).mean()
want_in = price > avg200
print(f"{SYMBOL} {price:.2f} vs 200-day {avg200:.2f} -> {'IN' if want_in else 'OUT'}")
held = {p["symbol"]: p["qty"] for p in requests.get(f"{API}/positions", headers=H).json()}
qty_held = held.get(SYMBOL, 0)
order = None
if want_in and qty_held == 0:
order = {"symbol": SYMBOL, "side": "buy", "qty": round(BUDGET / price, 4)}
elif not want_in and qty_held > 0:
order = {"symbol": SYMBOL, "side": "sell", "qty": qty_held}
if order:
order["client_order_id"] = f"trend-{SYMBOL}-{closes.index[-1]:%Y-%m-%d}"
order["dry_run"] = DRY_RUN
print(requests.post(f"{API}/orders", json=order, headers=H).json())
else:
print("No trade today.")
With DRY_RUN = True nothing is placed. You'll see the price it would get and whether it would fill now or at the next open. When it looks right, set it to False.
5. Run it once a day
- Easiest: run it yourself every evening. Orders placed after the close fill at the next market open.
- Mac: add a
cronline (your AI can write it for you). - Windows: use Task Scheduler to run
python bot.pydaily.
6. Make it yours
The starter bot is a launch pad, not a strategy. The interesting part is what you add. Pick one direction, then work it through with your AI. Ask it to explain the trade-offs, write the code, and tell you how you'd know whether the change actually helped.
- Better signals. "What else could tell me a stock is worth owning besides price trend: earnings surprises, revenue growth, insider buying? Which of those can I get for free, and how would I add one?"
- Let an AI read the news. "Have my bot pull today's headlines for each stock I hold, ask an AI model to rate them, and only buy when the trend and the news agree. Where could that go wrong?"
- Sizing and risk. "Instead of a fixed $1,000, how could I size each position by how volatile the stock is? How do I cap how much I can lose on any one name?"
- Exits. "When should my bot sell: a trailing stop, a time limit, the signal flipping? Build me one and log every reason it sells." (Orders here are market orders, so your bot checks its own exit rules and sends a sell when one triggers.)
- More than one idea. "Combine a trend rule and a value rule. How should they vote when they disagree?" Some builders ask two or three different AI models and only act when they agree.
- A memory. "Keep a journal: every decision, the inputs, and what happened next. Each weekend, summarize what worked and what didn't."
- Testing honestly. "How do I test this on data it hasn't seen, so I'm not fooling myself? What's overfitting and how do I spot it?"
- Your own edge. Know a sector from your job, a hobby, or school? "Help me turn what I know about [industry] into rules a bot can follow."
Or go broad: "Here's my bot and its results so far. What's the single change most likely to make it better, and how would I prove it worked?" Then ask it to argue the other side. The best builders treat their AI like a sparring partner, not an oracle.
7. Guardrails (read this one)
- Your record is permanent. Every fill is timestamped and public. There's no deleting the losers. That's the point.
- AI-written code has bugs. Keep
dry_runon until you've watched it decide correctly for a few days, and read what it prints. - Don't overtrade. A handful of trades a week is plenty. There's a daily cap on API orders anyway.
- Protect your key. Keep it in an environment variable, never in code you share or post. If it leaks, revoke it at /developers/keys and make a new one.
- Put hard limits outside the AI. Cap position size and orders per day in plain code your AI can't talk its way around.
- Compare against just holding. If your bot can't beat buying the same stocks and sitting still, it isn't adding anything yet.
- Be skeptical of perfect backtests. A strategy that looks flawless on past data usually isn't. The live record is what counts.
8. How you'll know if it's working
Your portfolio is ranked against the S&P 500 for 1D, 1W, 1M, 3M, YTD and 1Y. Give it weeks, not days. If it beats the index consistently, people will notice, and they can subscribe.
Coming soon
Connect ApesTogether to Claude or ChatGPT and just tell your AI what to do: "Check my portfolio and sell anything down more than 10% since I bought it." Every order asks you to confirm before it's placed.
Paper trading for information and education only, not investment advice. ApesTogether is not a broker or investment adviser. You must be 18 or older; payouts require a completed tax form. See the Terms of Service.