Let me check the available prompts from the Shoonya MCP server.
2026-06-30T18:10
ASSISTANT (hermes, glm-5.1)
No prompts are listed on the Shoonya MCP server. Let me also check the resources for any relevant documentation.
2026-06-30T18:10
ASSISTANT (hermes, glm-5.1)
No prompts or resources are available on the Shoonya MCP server either.
Let me check if there's an existing skill related to building algos:
2026-06-30T18:10
ASSISTANT (hermes, glm-5.1)
I see there's an `openalgo-vps-troubleshooting` skill that covers trading bot design patterns. Let me load it — it should have the relevant info for building a new algo.
2026-06-30T18:10
ASSISTANT (hermes, glm-5.1)
That skill has a lot of general bot design info. Let me check if there's a more specific prompt about creating a new algo, and also check the Shoonya MCP prompts more carefully.
2026-06-30T18:10
ASSISTANT (hermes, glm-5.1)
No specific prompts exist on the MCP server. Let me check if there's a design reference for the morning sniper (the most recent bot) that could serve as a template for creating a new algo:
2026-06-30T18:10
ASSISTANT (hermes, glm-5.1)
Got it. Here's a summary of what's available for building a new trading algo on this VPS:
---
**Available resources for creating a new algo:**
1. **Shoonya MCP tools** (connected right now) — 35+ tools for orders, positions, quotes, option chain, Greeks, historical data, margin calc, etc.
2. **OpenAlgo REST APIs** — Quotes, positionbook, orderbook, placeorder, funds, etc. at:
- Shoonya: `https://shoonya.openalgo.theworkpc.com/api/v1/`
- Flattrade: `https://flattrade.openalgo.theworkpc.com/api/v1/`
- Kotak: `https://kotak.openalgo.theworkpc.com/api/v1/`
3. **Existing bot patterns** (reference implementations):
- **Morning Sniper** (`/home/ubuntu/bots/morning_sniper/`) — VIDYA+Renko, one-shot, multi-broker, config-driven PROFILES
- **Claude Bot / Unified** (`/home/ubuntu/bots/Claude_bot/`) — multi-symbol strategy
- **LT 3-Candle** (`/home/ubuntu/bots/three_candle_bot/`) — dual-broker data flow
4. **Design patterns from the skill**:
- Config-driven `PROFILES` list (symbol, broker_exec, broker_candle, expiry, lot_size, etc.)
- Per-symbol SQLite DB
- LIMIT orders only (never MARKET — Shoonya drops them)
- Entry: LTP+3, Exit: LTP-3
- Pre-flight broker check before trading
- Exit retry cap: 2 attempts, then Telegram escalation
- One-shot per day per symbol
- EOD VIDYA at 3:40 PM
5. **Deployment pipeline**:
- systemd service file
- `morning_fix.sh` integration
- `auto_db_sync.py` for post-login backfill
- Telegram alerts
---
What kind of algo do you want to build? Give me the strategy idea (instrument, logic, timeframe, etc.) and I'll design and implement it using these established patterns.
2026-06-30T18:10
USER (hermes, glm-5.1)
there is multi question in the md file which can help us to build new algo for trading
2026-06-30T18:12
ASSISTANT (hermes, glm-5.1)
Let me look through the reference files — there might be a design questionnaire or template.
2026-06-30T18:12
ASSISTANT (hermes, glm-5.1)
Now let me check the deployment checklist and the strategy design document:
2026-06-30T18:12
ASSISTANT (hermes, glm-5.1)
Now let me check if there's a specific "new algo" questionnaire or template in the docs directory:
2026-06-30T18:12
ASSISTANT (hermes, glm-5.1)
Let me check the actual bot source files for design questionnaires:
2026-06-30T18:12
ASSISTANT (hermes, glm-5.1)
Found it! That's a comprehensive checklist. Let me also check the remaining reference files for any additional strategy design questionnaires:
2026-06-30T18:12
ASSISTANT (hermes, glm-5.1)
Now let me also check the sniper design document and the lot-size reference:
2026-06-30T18:12
ASSISTANT (hermes, glm-5.1)
Now I have the full picture. Here's the **Bot Creation Checklist** — a structured questionnaire/guide that walks through every decision needed to build a new trading algo:
---
**BOT CREATION CHECKLIST** (from `/home/ubuntu/bots/Claude_bot/minimax/BOT_CREATION_CHECKLIST.md`)
It covers 12 sections with questions you need to answer:
**1. Configuration** — What are you trading?
- Symbol & underlying?
- Futures symbol for LTP? (e.g. SBINFUT, not SBIN)
- Broker? (Shoonya/Flattrade/Kotak)
- Lot size? Strike step? Expiry format (DDMMMYY)?
- Product type? (NRML/MIS)
- ITM/OTM offset?
**2. API Calls** — How to get data?
- `quotes(symbol=)` NOT `quote(token=)`
- Set `client.timeout = 10.0`
- Validate option LTP — never fallback to futures price
**3. Stop Loss Logic** — When to cut?
- SL = entry_price - X points (same for CALL and PUT)
- Use option LTP for SL, not underlying
**4. Risk Management** — How many retries?
- Entry: max 2 attempts, verify via positionbook
- Exit: cancel open orders first, then place, verify fill
- Emergency hedge if exit fails twice
- Position verification: check positionbook, not order response
**5. Database** — What to store?
- Per-symbol SQLite with candle tables
- Incremental fetch, filter in-progress candles
- Closed candles only for indicators
**6. State Management** — What to persist across restarts?
- Position, entry_price, entry_time, option_symbol
- Emergency state, hedge symbol
- JSON file per symbol
**7. Telegram Alerts** — When to notify?
- Entry/exit/SL/hedge/emergency/error
- Use dedicated bot token + chat_id
**8. Polling Intervals** — How often to check?
- LTP: 5 min, Indicator: 15 min, Heartbeat: 30 min
- Market hours check (9:15-15:30, skip weekends)
**9. Market Hours** — Trading window?
- Skip non-trading hours, weekends, holidays
**10. Systemd Service** — Auto-restart?
- Service file with Restart=on-failure
- Enable on boot
**11. Morning Fix Integration** — Pre-market routine?
- Add restart + health check to morning_fix.sh
**12. Testing Checklist** — Before going live?
- Syntax check, service start, LTP fetch, DB updates, SL logic, Telegram, state persistence, position verification
Plus **10 Common Bugs** to avoid (wrong API method, stock vs futures LTP, no state persistence, etc.)
---
Want me to walk through these questions with you to design your new algo? Tell me your strategy idea and I'll fill in the checklist, or we can go section by section. What strategy are you thinking of?
2026-06-30T18:12
USER (hermes, glm-5.1)
ask me question one by one - but want to reitireate the fact - the system should have only one mm=oment of truth which is the broker which gives info - there should be also manual switch - after login -n which i say yes then only it should trade - go through the two candle or three candle bot - also pls make sure that the data is recorded in the data base for the 5 min candles of stock - you can visit https://chart.openalgo.theworkpc.com/ for clarity on candles database and its data sources - for example kotak doesnot have hstoricak data but only real time data - whereas shoonya and flattrade have historicak and current data - go through and go through questionalire - hope it makes sense
2026-06-30T18:18
ASSISTANT (hermes, glm-5.1)
Got it. Let me first study the 3-candle bot and the chart app's data setup, then I'll ask you questions one by one.
2026-06-30T18:18
ASSISTANT (hermes, glm-5.1)
Now let me also check the chart app data sources and the morning sniper config:
2026-06-30T18:18
ASSISTANT (hermes, glm-5.1)
I now have a thorough understanding of both bots. Let me start asking the questions one by one.
**Question 1 of the questionnaire:**
**Which underlying stock(s) / instrument(s) do you want this new bot to trade?**
For reference, the existing bots trade:
- Morning Sniper: SBIN, INDIGO, HAL, TCS, ULTRACEMCO (all NFO futures/options)
- LT 3-Candle: LT (Larsen & Toubro) NFO futures/options
Name the stock(s) — and if multiple, I'll ask per-stock details next.
2026-06-30T18:18
USER (hermes, glm-5.1)
can we start with sbin future citract for july
2026-06-30T18:20
ASSISTANT (hermes, glm-5.1)
Let me confirm the exact expiry and lot size for SBIN July futures.
2026-06-30T18:20
ASSISTANT (hermes, glm-5.1)
Got it. SBIN July futures:
- **Futures symbol**: `SBIN28JUL26FUT`
- **Expiry**: 28-JUL-26
- **Lot size**: 750
- **Strike step**: SBIN options have strikes — let me check what increments they use.
From the search results I can see strikes like 1420, 1290 — these vary. The existing morning sniper uses strike_step=100 for SBIN, but let me verify what's actually available.
2026-06-30T18:20
ASSISTANT (hermes, glm-5.1)
Confirmed. SBIN July contract details:
| Field | Value |
|-------|-------|
| **Futures symbol** | `SBIN28JUL26FUT` |
| **Expiry** | 28-JUL-26 |
| **Lot size** | 750 |
| **Strike steps** | ₹10 near ATM, ₹20 far OTM |
| **Product** | NRML |
Now, **Question 2:**
**Which broker should execute the trades for this SBIN contract?**
Your options (from existing setups):
- **Flattrade** — has both historical data API + live execution
- **Shoonya** — has intraday history + live execution (but no daily EOD history reliably)
- **Kotak** — live execution only (no historical data), would need Flattrade for candles
The Morning Sniper already runs SBIN on Flattrade. Would you like this new bot to also use **Flattrade** for both execution and data, or a different broker?
2026-06-30T18:20
USER (hermes, glm-5.1)
shoonya
2026-06-30T18:21
ASSISTANT (hermes, glm-5.1)
Got it — **Shoonya** for execution and intraday data, but since Shoonya's daily EOD history is unreliable, we'll need **Flattrade** for daily OHLC (same hybrid pattern as HAL/ULTRACEMCO in the sniper).
So: `broker_exec = SHOONYA`, `broker_data = SHOONYA` for 5-min candles, `broker_eod = FLATTRADE` for daily OHLC.
**Question 3:**
**What strategy/logic should this bot use to determine trade direction and entries?**
For reference, your existing bots use:
- **Morning Sniper**: VIDYA bias at 9:15 + 2-brick Renko confirmation → one-shot entry
- **LT 3-Candle**: VIDYA bias at 9:15 + 2-consecutive 15-min candle pattern → entry on 2nd candle hold
What's the strategy for this new bot? Some options:
- Same as one of the existing bots (VIDYA + Renko, 2-candle, etc.)?
- A different indicator/trigger?
- A different timeframe?
Describe it in your own words and I'll formalize it.