However, it appears to me that the copy_rates_range command only allows one by one to import the information of each stock, how could I with copy_rates_range import a list of stocks automatically without having to put a line for each one?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello, I am using the MetaTrader 5 module for Python 3 (import MetaTrader5 as mt5) and I want to import a list of stocks
tickers = ['Apple', 'Amazon', 'Facebook', 'Microsoft']
start = dt.datetime(2020, 11, 21)
end = start+ dt.timedelta(days = 7)
results[ticker] = mt5.copy_rates_range(tickers , mt5.TIMEFRAME_M1, start, end)
However, it appears to me that the copy_rates_range command only allows one by one to import the information of each stock, how could I with copy_rates_range import a list of stocks automatically without having to put a line for each one?