I need to see the list of my open orders updated each minute.
Launching this code:
to_date = datetime.now(pytz.timezone('Europe/Rome'))
from_date = to_date - timedelta(days = 1)
deals = mt5.history_orders_get(from_date, to_date, group=f"*{ticker}*")
df=pd.DataFrame(list(deals),columns=deals[0]._asdict().keys())
df['time_setup'] = pd.to_datetime(df['time_setup'], unit='s')
df['time_done'] = pd.to_datetime(df['time_done'], unit='s')
I see that the dataframe resulting considers only those positions closed on the previous day, and not also those on the current day.
dataframe not updated
Could you help me?
I tried changing the start date and to date, also modifying the timezones (utc) but the list does not update and remains qual to the one of the previous day