Skip to content

Latest commit

 

History

History
67 lines (51 loc) · 1.38 KB

File metadata and controls

67 lines (51 loc) · 1.38 KB

LSEG Market Data Automation - Bare Minimum Example

This is a demonstration of how to schedule a Python script with Windows Task Scheduler.

Files

File Purpose
lseg_market_data_example.py Main script (32 lines)
run_market_data.bat Batch wrapper (4 lines)
TASK_SCHEDULER_SETUP.md How to schedule it
PRODUCTION_CHECKLIST.md What to add before production

Quick Start

1. Install Dependencies

pip install lseg-data

2. Test Script Manually

cd C:\path\to\script
python lseg_market_data_example.py

Expected output:

Session opened
Data saved to market_data_20260804.csv
Done

3. Test Batch File

run_market_data.bat

4. Schedule with Task Scheduler

Follow steps in TASK_SCHEDULER_SETUP.md

Output

Creates: market_data_YYYYMMDD.csv in current directory

Example:

Instrument,Identifier,TR.PriceClose
IBM,IBM.N,180.45
MSFT,MSFT.O,425.30

Code Structure

Python Script:

  • Opens LSEG session
  • Retrieves 2 instruments (IBM.N, MSFT.O)
  • Gets 1 field (TR.PriceClose)
  • Saves to CSV with today's date
  • Returns exit code 0 (success) or 1 (failure)

Batch File:

  • Changes to script directory
  • Runs Python script
  • Returns exit code

That's it! See PRODUCTION_CHECKLIST.md for what's missing.