This is article article about Download Forex Price Data is ok from QuantInsti but note that Yahoo Finance for forex data is absolute trash due to unreliable gaps
https://blog.quantinsti.com/download-forex-price-data-yfinance-library-python/
I have solutions via my Python bot trading course on this
Build or preserve your trading wealth by watching this video https://quantlabs.net/banking/
i also have a demo of FXCM with Python