Research
Scheduled scripts
Run a Python script automatically, for example to refresh a watchlist each evening.
Creating a schedule
- In the Python tab, open the script and press Schedule. The Schedules tab opens with a new schedule.
- Choose the Days (or Weekdays / Every day).
- Choose Once, at a time, or Repeatedly every so many minutes between two times — for example every 15 minutes from 09:15 to 15:30.
- Leave Switched on ticked and press Create schedule.
All times are Indian Standard Time (IST), the same clock as the markets the app reads.
Managing schedules
- Each schedule shows its rule, its next run and how the last run ended.
- The checkbox switches it on or off. Run now runs it immediately; Stop ends a run; the pencil edits; the bin deletes it with its history.
- The arrow beside a schedule shows its history; click a run to read what the script printed.
When schedules run
- Schedules run only while the app is open. A run that came due while it was closed, or the computer asleep, is recorded as Missed and is not made up.
- If a run is still going when the next comes due, the next is Skipped.
- A scheduled run is exactly like pressing Run: same Python, same data access, same permissions.
Keeping a watchlist up to date
import protrade as pt
bars = pt.bars_many(pt.universe("Nifty 50"), "D", limit=260, errors="skip")
above = [s for s, df in bars.items()
if len(df) > 200 and df.close.iloc[-1] > df.close.rolling(200).mean().iloc[-1]]
pt.set_watchlist("Above the 200-day", above)Schedule a script like this for after the close — say weekdays at 16:00 — and the list is fresh every evening.