SignalX is a trading app for anyone looking to diversify their funds into systematic and algorithmic intraday trading strategies.
- ATM Straddle — Simultaneously sells/buys the at-the-money CE and PE. Supports a skew check (see
NEXT_PUBLIC_DEFAULT_SKEW_PERCENTbelow) so both legs are entered near their fair premium, plus configurable SL and target exit strategies per leg or combined. - ATM Strangle — Same idea as the straddle but with CE and PE legs offset from the ATM strike, for a wider breakeven range.
- Subscribe & Chase — A trending 40-EMA strategy, available for Nifty futures only. Recomputes the 40-period EMA on hourly candles and trails the stop-loss as price moves in the trend's favor, converting to a market order on rollover. Entry, exit, and SL-update signals are posted to Slack.
-
Kite Connect — Go to https://kite.trade and sign up. Create an app and pay Zerodha the ₹500/month fee.
- Copy the
API KeyandAPI Secret— you'll need them for environment variables. - Set the Redirect URL to
https://<your-vps-domain>/api/redirect_url_kiteafter deployment.
- Copy the
-
VPS — A Linux VPS (Ubuntu 22.04+ recommended) with at least 1 vCPU and 1 GB RAM.
-
Node.js — v20+ (use nvm to install).
-
Yarn — v4 (
npm install -g yarn). -
PostgreSQL 16 — Install on the VPS:
sudo apt install -y postgresql-16 sudo -u postgres psql -c "CREATE DATABASE trading_db;" sudo -u postgres psql -c "CREATE USER trading_user WITH PASSWORD 'yourpassword';" sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE trading_db TO trading_user;"
-
Redis 7 — Install on the VPS:
sudo apt install -y redis-server sudo systemctl enable redis-server sudo systemctl start redis-server -
Grafana Cloud (optional, for observability) — Sign up at https://grafana.com/products/cloud/. Navigate to Connections → OpenTelemetry to get your OTLP endpoint and API token.
git clone https://github.com/anil1kuppa/kha-ching.git
cd kha-ching
yarn installCopy the example env file and fill in your values:
cp .env.example .envRefer to .env.example for all available variables and their descriptions. Key variables to set:
| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string, e.g. postgresql://trading_user:yourpassword@localhost:5432/trading_db |
REDIS_URL |
Redis URL, e.g. redis://127.0.0.1:6379 |
KITE_API_KEY |
Your Kite Connect API key |
KITE_API_SECRET |
Your Kite Connect API secret |
SECRET_COOKIE_PASSWORD |
Random 32+ character string for session encryption |
TZ |
Must be Asia/Kolkata |
MOCK_ORDERS |
Set true during testing — skips real order placement |
OTEL_EXPORTER_OTLP_ENDPOINT |
Grafana Cloud OTLP endpoint (optional) |
OTEL_EXPORTER_OTLP_HEADERS |
Grafana Cloud auth header (optional) |
yarn drizzle:pushyarn build
yarn startThe app runs on port 3000 by default. Use a reverse proxy (nginx, Caddy) to expose it over HTTPS.
docker-compose.yml only builds and runs the app container — it does not provision Postgres or Redis. Before running docker compose up, make sure Docker, PostgreSQL, and Redis are all installed and PostgreSQL/Redis are reachable (either running on the host, or as separate containers), then point DATABASE_URL and REDIS_URL in .env at them:
cp .env.example .env # fill in your values, including DATABASE_URL and REDIS_URL
docker compose up app # production build
# or
docker compose up app-dev # dev build with hot reloadThe app health-check endpoint is GET /api/health.
See .env.example for the full list of environment variables with inline documentation.
Default lots pre-filled in the trade form. For example, 2 lots if you regularly trade 150 quantity of Nifty options.
Allowed skew (% difference between CE and PE premiums) before entering a straddle. 5–15 is a good range.
Skew retry behavior: Before entering a straddle, the app checks whether the live skew is within the threshold. If too high, it retries every 2 seconds. The allowed skew threshold widens dynamically over time:
- While more than 50% of the window remains → use
maxSkewPercent - After 50% of time has elapsed → blend linearly toward
thresholdSkewPercent - If the window expires → trade is taken regardless of skew if
takeTradeIrrespectiveSkewis enabled, otherwise cancelled
Default square-off time in 24-hour hh:mm format, e.g. 15:20 for 3:20 PM.
Default SLM BUY order percentage placed after an initial order fills. Changeable per trade during setup.
yarn dev # starts dev server with OTEL instrumentationOpen http://localhost:3000 in your browser. Set MOCK_ORDERS=true to avoid placing real orders during development.
yarn test # all tests
yarn unit-test # unit tests only
yarn int-test # integration tests (requires running Postgres + Redis)- All access tokens are saved in encrypted session cookies via
SECRET_COOKIE_PASSWORD. Do not share this value with anyone. - Redis stores job queues and scheduling data including Zerodha profile details. Do not expose your Redis URL.
- Zerodha tokens expire around 7:35 AM IST daily — log in to the app each morning after 7:45 AM to refresh.
SignalX is MIT licensed.