You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im trying to integrate 5ers prop account to fetch ticks from mt5 terminal which is running in GMT+2 when i tried to get tick im not getting latest tick
For Ex:
Current GMT+2 time is 6:17
Current UTC time is 4:17
my request to get tick is
current_time = datetime.now(pytz.timezone("Etc/GMT-2"))
start_time = current_time - timedelta(minutes=interval)
logging.info("Candle Request From : "+ str(start_time)+ ", To: "+str(current_time))
Candle Request From : 2024-11-25 06:15:00.005051+02:00 , To: 2024-11-25 06:16:00.005051+02:00
candles = self.mt5.copy_rates_range(self.symbol, self.get_mt5_time_format(interval), start_time, current_time)
if candles is not None and len(candles) > 0:
candles_frame = pd.DataFrame(candles)
logging.info("Recieved Tick "+ str(pd.to_datetime(candles_frame['time'], unit='s', utc=True)))
candles_frame['time'] = pd.to_datetime(candles_frame['time'], unit='s', utc=True).dt.tz_convert(pytz.timezone("Etc/GMT-2")
logging.info("After Candle Converted to GMT+2 "+ str(candles_frame['time']))
latest_candle = candles_frame.iloc[-1]
self.process_ticks_to_ohlc(latest_candle, candles_frame['time'], interval)
i should receive 6:15 candle but im getting 4:16 candle
LOGS
Recieved Tick 0 2024-11-25 04:15:00+00:00
1 2024-11-25 04:16:00+00:00
Name: time, dtype: datetime64[ns, UTC]
2024-11-25 06:16:00,075 - INFO - After Candle Converted to GMT+2 0 2024-11-25 06:15:00+02:00
1 2024-11-25 06:16:00+02:00
Name: time, dtype: datetime64[ns, Etc/GMT-2]
2024-11-25 06:17:00,076 - INFO - OHLC {'Open': 2701.85, 'High': 2702.27, 'Low': 2701.56, 'Close': 2702.22, 'trading_symbol': 'XAUUSD', 'Volume': 343, 'timestamp': '2024-11-25T06:17:00Z', 'time_frame': 1, 'is_last': False}
2024-11-25 06:17:00,085 - INFO - 1 Sleep Until 2024-11-25 06:17:00+02:00
that received tick is matching with GMT+2 2024-11-25 04:16:00+00:00
The text was updated successfully, but these errors were encountered:
Im trying to integrate 5ers prop account to fetch ticks from mt5 terminal which is running in GMT+2 when i tried to get tick im not getting latest tick
For Ex:
Current GMT+2 time is 6:17
Current UTC time is 4:17
my request to get tick is
current_time = datetime.now(pytz.timezone("Etc/GMT-2"))
start_time = current_time - timedelta(minutes=interval)
logging.info("Candle Request From : "+ str(start_time)+ ", To: "+str(current_time))
Candle Request From : 2024-11-25 06:15:00.005051+02:00 , To: 2024-11-25 06:16:00.005051+02:00
candles = self.mt5.copy_rates_range(self.symbol, self.get_mt5_time_format(interval), start_time, current_time)
if candles is not None and len(candles) > 0:
candles_frame = pd.DataFrame(candles)
logging.info("Recieved Tick "+ str(pd.to_datetime(candles_frame['time'], unit='s', utc=True)))
candles_frame['time'] = pd.to_datetime(candles_frame['time'], unit='s', utc=True).dt.tz_convert(pytz.timezone("Etc/GMT-2")
logging.info("After Candle Converted to GMT+2 "+ str(candles_frame['time']))
latest_candle = candles_frame.iloc[-1]
self.process_ticks_to_ohlc(latest_candle, candles_frame['time'], interval)
i should receive 6:15 candle but im getting 4:16 candle
LOGS
Recieved Tick 0 2024-11-25 04:15:00+00:00
1 2024-11-25 04:16:00+00:00
Name: time, dtype: datetime64[ns, UTC]
2024-11-25 06:16:00,075 - INFO - After Candle Converted to GMT+2 0 2024-11-25 06:15:00+02:00
1 2024-11-25 06:16:00+02:00
Name: time, dtype: datetime64[ns, Etc/GMT-2]
2024-11-25 06:17:00,076 - INFO - OHLC {'Open': 2701.85, 'High': 2702.27, 'Low': 2701.56, 'Close': 2702.22, 'trading_symbol': 'XAUUSD', 'Volume': 343, 'timestamp': '2024-11-25T06:17:00Z', 'time_frame': 1, 'is_last': False}
2024-11-25 06:17:00,085 - INFO - 1 Sleep Until 2024-11-25 06:17:00+02:00
that received tick is matching with GMT+2 2024-11-25 04:16:00+00:00
The text was updated successfully, but these errors were encountered: