--------------------------------------------------------------------------------
                   DOWNLOAD COTATIONS FROM IG
--------------------------------------------------------------------------------

1/ install (windows/debian)
2/ configure 'download.py'
3/ Launch 'download.py'


--------------------------------------------------------------------------------
install on windows

1/ install python
https://www.python.org/downloads/windows/
- A la premire fentre d'installation cochez les 2 cases : PATH et l'autre 

2/ pip : pandas, multidict

pip install pandas

pip install multidict

pip install trading_ig

--------------------------------------------------------------------------------
install on debian 

su root
apt-get install sudo
/sbin/usermod -aG sudo debian

# python
sudo apt update
sudo apt install python3 python3-pip
sudo python3 --version

# pandas
sudo apt install python3-pandas
sudo apt install python3-multidict
# trading_ig
# https://www.makeuseof.com/fix-pip-error-externally-managed-environment-linux/
cd /usr/lib/python3.11/
sudo rm EXTERNALLY-MANAGED
sudo pip install trading_ig

--------------------------------------------------------------------------------
configure  'download.py' 

1/ Generate API_KEY on IG
Authenticate > Configuration > Paramtres de trading > Cls de l'API WEB

2/ configure  'download.py'
 
# Paramtres de l'API IG
username = "my-ig-username"
password = "my-ig-password"
api_key = "my-ig-api-key--------------------------"
acc_type = "LIVE"
acc_number = "my-ig-account-number"

# Be carefull, there is a limitation per day for downloading


--------------------------------------------------------------------------------
launch  'download.py' 

1/ launch // python3 download.py ${INDICE} "${PERIOD}" "${DATE1}" "${DATE2}"

python download.py IX.D.NASDAQ.IFE.IP "30min" "2023-12-01 09:00:00" "2023-12-01 09:30:00"


2/ Get output

IX.D.NASDAQ.IFE.IP_20231201_090000_20231201_093000.csv


--------------------------------------------------------------------------------
Annnexes


https://www.andlil.com/forum/api-ig-et-recuperation-des-donnees-de-marches-t57246.html


