How to get longer historical price from mt5?

To add comments, please log in or register
johnnyb15
7
johnnyb15  

Hi everyone,

I'm now using MetaTrader5 libraby for python to get history price data. However, I can't get the the price that from 2014 backward. I just able to get from 2015 to now.

My code is as below

usdjpy2 = MT5CopyRatesRange("USDJPY", MT5_TIMEFRAME_M15, datetime(2009,1,5) ,datetime(2019, 1, 3))

and the output is

>> (MT5Rate(time=datetime.datetime(2015, 11, 3, 7, 0), open=120.657, low=120.682, high=120.657, close=120.674, tick_volume=377, spread=9, real_volume=487220000),)

How to fix it to get longer period of data?

Thanks a lot!

Hakim Precious
355
Hakim Precious  
johnnyb15:

Hi everyone,

I'm now using MetaTrader5 libraby for python to get history price data. However, I can't get the the price that from 2014 backward. I just able to get from 2015 to now.

My code is as below

and the output is

How to fix it to get longer period of data?

Thanks a lot!

check with broker if they have longer  period of data

also try another broker

To add comments, please log in or register