RN TradeLab

User Guide

Everything the app can do, before you download it. This is the same guide built into the app (Help → User Guide).

On this page 1. Getting started2. The tabsStrategy library (examples you can learn from and tune)Money & risk management3. A honest-testing checklist4. Files worth knowing

RN TradeLab - User Guide (v0.4)

A trading research app with one purpose: **prove your strategy works on

data it has never seen, before you risk money on it.**

Educational tool only. Not investment advice. No performance guarantees.

The app never places orders.


1. Getting started

Windows app (most users)

  1. Double-click RN_TradeLab.exe. That's it - no Python, no installs. (Windows SmartScreen may warn about a new unsigned app: click More info -> Run anyway.)
  2. Sign Up on the login screen (email + password, tick the educational-use acknowledgement). Your account is bound to this computer and starts a 14-day trial - the status bar shows days left.
  3. Trying it without a broker - nothing to configure: Tab 1 -> Load Sample Data -> Tab 3 -> **Run Walk-forward Backtest**. Every research feature works on the 50 DEMO stocks.
  4. Only when you want real NSE data do you touch config.json (see "Connecting Upstox" below).
  5. After the trial - Rs 499/month: click Activate License on the login screen, send us the request (one click via Gmail), and we reply with your key. Paste it, Activate, done - the app then shows "Licensed until <date>" and reminds you near renewal. A subscription works fully with Sample Data even before your Upstox API is ready.

Where your files live

Everything you own - **config.json, your strategies, downloaded data,

saved portfolios, your account and licence** - is kept in one stable

folder:

Documents\RN TradeLab\

Use Help -> Open My Data Folder to jump straight there. Because this

folder is separate from the program itself, you can run RN_TradeLab.exe

from anywhere and it always finds your work.

Updating to a new version

  1. Download the new version and unzip it anywhere you like.
  2. Run the new RN_TradeLab.exe.

That's all. Your settings, strategies, data, portfolios and licence are

picked up automatically - nothing to copy, nothing to re-activate. (If

you are updating from a very old build that kept files beside the exe,

they are moved into the folder above automatically on first run.)

Running from source (developers)

Install Python 3.11+ (tick "Add to PATH"), copy the project folder,

pip install -r requirements.txt, then python main.py.

Free real data - Yahoo Finance (no account needed)

In Tab 1 set Data source to *Yahoo Finance (free)* and click

Download. You get the rolling last ~60 days of 5-minute candles for

your whole universe - real NSE prices, no broker, no signup. Two

things to know: quotes are DELAYED (research only - Live Signals and

the sector heatmap still need Upstox), and the window rolls, so

update regularly: the app merges each download into your local

history, which keeps growing beyond 60 days. Skip 60+ days and that

gap is gone for good.

Connecting Upstox (full history + live features)

  1. Create an app at https://account.upstox.com/developer/apps (redirect URI can be http://localhost).
  2. In Tab 1, click Broker Settings (Upstox)... and paste your api_key, api_secret and access_token - the app writes config.json for you and unlocks downloading. This is the only place you need to enter broker details - no hand-editing of config files.
  3. Token validity varies with your Upstox app settings - some tokens expire daily (~3:30 AM IST), others last much longer. If downloads start failing with a 401 error, generate a fresh token and paste it into Broker Settings.

Connecting Angel One

  1. Create an app at https://smartapi.angelone.in/ and copy its API Key.
  2. Turn on TOTP at https://smartapi.angelone.in/enable-totp and add it to an authenticator app (Google Authenticator, Microsoft Authenticator...).
  3. In Tab 1, open Broker Settings... > Angel One (NSE/BSE), enter the API Key, your Client Code, PIN and the 6-digit TOTP code, and click Log in & Save.
  4. One login per trading day. The next day Broker Settings shows Log in for today - click it and enter a fresh TOTP code. Optional: tick Log in automatically each day and paste the TOTP secret key (the long code shown when you enabled TOTP) - the app then logs in by itself. This saves your PIN and the key on your computer, so leave it off on a shared PC.
  5. With more than one India broker connected (Upstox, Fyers, Angel One), pick which one to use under Preferred NSE/BSE broker in Broker Settings.

2. The tabs

Tab 1 - Download Data

constituents and extends sectors.csv (run after each rebalance).

(incremental: only new candles are fetched).

Tab 2 - Strategies

logic, click Add Strategy - it is validated (syntax, structure,

a smoke-test run) and instantly appears in the dropdowns.

re-validates. Broken files are listed as LOAD ERROR and kept out of

the dropdowns until fixed.

timestamps must be real candles; never use future rows.

Tab 3 - Backtest

SL or target), Capital, Dataset (universe, custom dataset, or

Sample Data) and Timeframe (5/10/15/30/60 min or Daily).

time window, minimum ATR%. Evaluated on the previous candle

(no lookahead).

once breached, no new entries in that stock for the period.

See Trades on Chart for a candlestick view of every trade: entry

and exit joined by a dotted line (green = winner, red = loser), faint

dashed stoploss and target levels, and a tinted background showing

where out-of-sample data begins. Navigate with the slider, jump

straight from one trade to the next, zoom with + / - or the mouse

wheel, and press Fit Trade to fill the screen with a single trade

so you can see exactly how it played out.

Click any column header to sort. Click a curve thumbnail for the full

equity chart (black = in-sample, blue = out-of-sample) and the

trade-by-trade list with quantities and rupee P&L.

universe by price (from local data) and by any numeric column you add

to fundamentals.csv (e.g. exported from screener.in).

Tab 4 - Optimize

a dataset and timeframe. Set each parameter's Start / Stop / Increment.

will take; a cap prevents runaway runs (reduce your ranges if warned).

row per parameter combination, ranked by in-sample Sharpe. The

out-of-sample (OS) columns beside each row are the honest reality

check - a row that is strong in-sample but weak out-of-sample is

overfit. Pick a combination that holds up in BOTH, then set those

values in your strategy and use the Backtest tab as usual.

Tab 5 - Portfolio

sector, or Suggest Portfolio** - a correlation-aware optimizer

that maximizes the combined in-sample Sharpe (out-of-sample is never

touched during selection; it remains the judge).

Sharpe, drawdown, rupee P&L and the equity curve under a realistic

capital model (capital split equally across stocks; idle when a stock

has no trade).

Tab 6 - Live Signals

Now**. The strategy, timeframe and filters are LOCKED to what that

portfolio was built and validated with - you cannot accidentally

scan an untested configuration. Trade the alerts manually in your

broker app.

stored history so indicators compute exactly as in the backtest.

Alerts

an alert runs itself automatically, checking the instant each bar

closes - as fast as every 1 minute - for as long as the app is open.

or a whole Universe at once), any indicator and one of its conditions

(e.g. "Close crosses above the line"), and a timeframe from 1 min up.

Turn on Sound and/or a Visual popup under Notify me with. Base accounts can run up to 5 active alerts at a time; Gold is unlimited.

current Status; Edit, Duplicate and Delete act on whichever row is

selected there.

scan, not just the ones that fire - a fired alert, an error, or a

quiet "scanned N symbols - no signal" confirmation, so you always

know it's actually running rather than wondering if it's stuck. The

newest scan's lines sit at the top with a light highlight; once a

newer scan comes in, that batch collapses into one row you click to

expand. A fired alert shows exactly which indicator and length

triggered it, e.g. "AAPL - Alert1 - SMA(50): Close crossed above SMA

line".

symbols need must be connected in Broker Settings. You do not need

the Chart tab's Live Data checkbox turned on - that only affects the

chart itself, not Alerts.

Tab 7 - Performance

compares your live results to the backtest - the whole point of the

manual-trading phase.

Tab 7 - Knowledge Base

sessions converted to IST (daylight-saving handled automatically),

last price and day change.

click a sector to drill into its stocks.


Strategy library (examples you can learn from and tune)

Every strategy below is a plain .py file in your strategies folder -

open any of them in Tab 2 to read the code and comments. All are long

only, and all expose tunable inputs in the Optimize tab.

Indicator based

| Strategy | Idea |

|---|---|

| EMA Crossover | fast EMA crosses above slow EMA |

| MACD Crossover | MACD line crosses above its signal line |

| RSI Reversal | RSI climbs back up through oversold (buys the bounce) |

| Bollinger Breakout | close pushes above the upper band |

| Bollinger Mean-Reversion | close reclaims the lower band, target = middle band |

| Stochastic Crossover | %K crosses %D while oversold |

Price structure (no indicators)

| Strategy | Idea |

|---|---|

| Recent-High Breakout | breaks the highest high of the last N candles |

| Support Bounce | dips to recent support and closes back above it |

| Inside Bar Breakout | breaks out of a coiled inside-bar pattern |

| Gap-Up Continuation | opens well above yesterday's close |

| Gap-Down Fill | opens well below, targeting the gap fill |

| ORB Breakout | breaks the opening range of the day |

Combinations (a filter plus a trigger)

| Strategy | Idea |

|---|---|

| EMA Trend + RSI Pullback | buy dips only while the trend is up |

| MACD + Volume Confirm | crossover only if volume beats its average |

| VWAP Bounce | intraday dip to VWAP that holds, on an up day |

Tips: compare Bollinger Breakout against Bollinger Mean-Reversion

on the same stocks - the same indicator, opposite ideas, and only the

out-of-sample column tells you which your market rewards. Gap strategies

need real market data (sample data has no overnight gaps).

Money & risk management, attached settings

Attaching settings to a strategy

  1. Next to the strategy on the Chart and Backtest tabs, click ⚙ Attach to save the current Regime, Risk and Exits settings with that strategy. The button turns green and reads Attached.
  2. That strategy then always runs with its attached settings - Chart, Backtest, Basket, Optimize, Signals and new Paper Trading sessions - whatever the global Settings say. Other strategies keep using the global Settings.
  3. The button's menu replaces the attachment with the current global Settings, or detaches it. Changing Settings while an attached strategy is selected asks whether to update its attachment.

Optimizing Regime, Risk and Exits

  1. In Optimize This Instrument, tick Regime, Risk and/or Exits under Also optimize settings, then tick Optimize? on the rows to sweep (ATR length, Min ATR %, loss limits, stop %, target %, skip weekday, time window 1...). Sweeping a setting that's off switches it on for the test.
  2. Select the best row and click Attach selected settings to strategy.

Fixed Fractional sizing

Settings > General > Position sizing > Fixed fractional (% risk per trade). Contracts = equity × risk % ÷ (entry-to-stop distance × point value), rounded down; equity compounds from the Capital you set. The stop comes from the strategy or Settings > Exits. A trade whose stop costs more than the risk budget takes 1 contract.

Portfolio daily stop

Settings > Risk > Portfolio daily stop % (Basket runs). Once the whole basket's realized loss for the trading day reaches the limit, no new entries in any symbol until the next day. The trade that crosses it still completes.

End-of-week exit

Settings > Exits > End-of-week exit: close open positions at the week's last bar, or tick at a set time on the last day (e.g. 15:00 exchange time) to exit at that bar's open. Reason shown: EOW.

Weekday and time-window filters

Settings > Regime > Day & Hour Regime: allow entries only on chosen weekdays, and only inside up to three time windows (both ends included), by the bar's close time (TradeStation) or open time.

TradeStation CSV data

Data Center imports TradeStation exports as they are: the date order is read from the whole file, and Bar times in the file (Auto-detect) converts TradeStation's bar close-time stamps to the open-time convention RN TradeLab stores. Name the file after the symbol (e.g. @ES.csv) so it matches your futures registration.

Strategy code: stop entries and own exits

A strategy can place a stop entry with Signal(..., entry=price, entry_stop_bars=1) (TradeStation's "next bar at X stop", with gap fills at the open), and decide its own exits with exit_at / exit_at_price / exit_at_reason - used to match TradeStation's stop-and-reverse, SetStopLoss and SetProfitTarget trade for trade. PARAMS "default" values are now what a strategy runs with when nothing is applied.

3. A honest-testing checklist

curve-fitting - the app is designed to show you exactly that.

what to trade forward, but it flatters historical results slightly

(survivorship-style bias). Don't read filtered backtests as "what I

would have earned".

whether reality matches the backtest before risking capital.


4. Files worth knowing

| File | Purpose |

|---|---|

| config.json | API keys, token, capital, filter/risk settings |

| stocks.csv | current download universe |

| nifty50/100/200.txt | universe lists (refresh from NSE in-app) |

| sectors.csv | symbol-to-sector mapping (editable) |

| fundamentals.csv | your fundamental data for dataset filters |

| strategies/*.py | one file per strategy |

| data/*_5min.parquet | downloaded / sample candles |

| data/portfolios/*.json | saved portfolios (with settings stamp) |

| data/datasets/*.json | saved custom datasets |

| data/trade_journal.csv | your live trade log (opens in Excel) |

| data/users.db | local accounts (trial/license, machine binding) |


*Start small. Validate honestly. Let the data say no.*

Tab 8 - Knowledge Base

breadth snapshot (advancing vs declining).

close, whether that gap is HOLDING or FADING since the open, and how

today's volume compares with the stock's own 20-day average. This is

the live view of what the Gap-Up Continuation and Gap-Down Fill

strategies backtest.

drill into its stocks.

of how RN TradeLab uses them.

The live panels refresh every 60 seconds during market hours and need an

Upstox connection (Yahoo's free data is delayed, so it powers research

rather than live views).

Top Gainers/Losers, Gap & Momentum and the Sector Heatmap each have a

Universe dropdown - All, Nifty 50/100/200, or any custom dataset

you've created - so you can narrow live movers to the stocks you

actually care about instead of your whole downloaded universe.

Download RN TradeLab