DEV Community

rkang30
rkang30

Posted on

I built a free, open-source trading bot starter (Next.js)

A minimal, open-source trading bot built on the Picckles Signals API — a read-only REST API for stock trading signals. It's Next.js (App Router) + TypeScript, and deploys to Vercel with a daily cron out of the box.

What it does

The bot runs on a daily tick that:

  • Checks the API for SELL/HOLD decisions on any open positions
  • Pulls today's BUY signals, sized to your budget
  • Persists state to Upstash Redis
  • Shows everything on a dashboard — open positions, trade history, and a manual run trigger

It ships in paper-trading mode by default. Wiring up a real broker is a single function — placeOrder in src/lib/bot.ts — everything else stays the same.

The signals

Two strategies are available out of the box:

  • double7-guarded (default) — buys strong uptrends on short-term lows, with a VIX-based crash filter. Typical hold: 2–3 weeks.
  • rs-pullback — buys relative-strength leaders during fast dips. Typical hold: 2–5 days.

Signals are the same for every subscriber on a given plan — no personalization, nothing account-specific, just "here's what the strategy says to do today":

\javascript
const res = await fetch(
"https://picckles.com/api/v1/signals/double7-guarded?budget=200",
{ headers: { Authorization:
Bearer ${KEY}` } }
);
const feed = await res.json();

for (const s of feed.entries) {
console.log(BUY ${s.suggestedQuantity} ${s.symbol} @ ~$${s.price});
}
`\

Why I built it

I've been trading these strategies on my own account and wanted something a developer could clone and have paper-trading running in a few minutes — without writing their own signal generation, position sizing, or scheduling from scratch.

Setup needs a Picckles API key (free tier available) and an Upstash Redis instance — that's it.

Links

Would love feedback on the architecture, or holes in the strategies themselves — happy to answer questions in the comments.

Top comments (0)