- NIFTY 50: Resolves constituents from Upstox NSE instruments JSON (symbol list in
server/src/data/nifty50-symbols.json; update when NSE rebalances). - Strategy: Combines live intraday momentum with Upstox v3 daily historical candles (~20d return, SMA trend, low-volatility tilt). Open positions: charge-aware optimal exits (lock small net gains on pullback/reversal), defensive trim when estimated net-after-fees is negative but full stop not hit, and stop-loss on net or gross % (
STRATEGY_*). Optional fixed ₹ TP only withSTRATEGY_ENABLE_HARD_TAKE_PROFIT=true. Seeserver/src/services/strategy.js. Research scaffolding only, not investment advice. - Orders: Buy/sell via Place Order API (
TRADING_ENABLED=truerequired). The UI no longer exposes a manual order form; it is now focused on strategy-driven execution and API-first order placement. - Schedule:
node-cronruns at NSE cash open (default 09:15 IST, Mon–Fri) whenAUTO_EXECUTE_ON_OPEN=trueand trading is enabled. Optional EOD job (default 15:15 IST, 15 minutes before 15:30 close) sells all short-term positions when combined unrealized P&L > ₹EOD_MIN_NET_PROFIT_INR(default 50). After a successful sell-all, the EOD cron is stopped unlessEOD_STOP_CRON_AFTER_SELL=false(restart the process to register EOD again). Does not include delivery holdings. Holidays are not filtered. - Charges: Optional estimated sell-side fees (
CHARGES_*inserver/.env) feed into EOD and strategy net exit logic — calibrate against your Upstox tariff; not exact to the paisa. - Security: OAuth
client_secretstays on the server; access tokens are stored encrypted (TOKEN_ENCRYPTION_KEY); Helmet, CORS, rate limits, and same-origin checks on mutating requests.
-
Create an app at Upstox Developer and set redirect URI to
http://localhost:4000/api/auth/upstox/callback(or your deployed URL). -
Copy
server/.env.exampletoserver/.envand fill values. Generate a long randomTOKEN_ENCRYPTION_KEY. -
Copy
client/.env.exampletoclient/.envif your API origin differs fromhttp://localhost:4000. -
Install and run:
npm install
npm run dev- Click Connect Upstox, complete login, then use Load constituents and Refresh signals. The UI now focuses on strategy execution; manual order entry is not shown in the browser. Enable
TRADING_ENABLED=trueonly when you intend to send real orders.
Registered algo apps may need the X-Algo-Name header (set UPSTOX_ALGO_NAME in server/.env). Confirm requirements with Upstox for your account type.