Gym-Trading-Env icon indicating copy to clipboard operation
Gym-Trading-Env copied to clipboard

The renderer is not working in my system

Open RitwikGhoshLives opened this issue 1 year ago • 6 comments

First of all thank you for this amazing environment. I am using Anaconda and Spyder. I am facing the following problem.

Screenshot 2023-09-05 210020

Next I tried Screenshot 2023-09-05 214850

It works to run the code with no error. But in the browser I find no graph

Screenshot 2023-09-05 213514

RitwikGhoshLives avatar Sep 05 '23 16:09 RitwikGhoshLives

I suggest you to downgrade your gymnasium version to the one I used when I created the env

ClementPerroud avatar Sep 07 '23 07:09 ClementPerroud

I have done it. I have downgraded the gymnasium version to 0.28.1. The user warning error is not coming any more. how ever the web page is still showing blank. Following error I am getting in spyder Screenshot 2023-09-07 190558

RitwikGhoshLives avatar Sep 07 '23 13:09 RitwikGhoshLives

I have done it. I have downgraded the gymnasium version to 0.28.1. The user warning error is not coming any more. how ever the web page is still showing blank. Following error I am getting in spyder Screenshot 2023-09-07 190558

Your dataframe index obviously isn't a Timestamp index.

sebnapi avatar Sep 08 '23 17:09 sebnapi

No my data frame index is in timestamps cause I am getting the result like market return portfolio return. Only the renderer is not working. 265762786-77c38aff-cab9-4a75-8d1b-fb2fbd87a038

RitwikGhoshLives avatar Sep 09 '23 04:09 RitwikGhoshLives

No my data frame index is in timestamps cause I am getting the result like market return portfolio return. Only the renderer is not working. 265762786-77c38aff-cab9-4a75-8d1b-fb2fbd87a038

I tried the renderer yesterday and it works! You have to debug it by yourself, what @ClementPerroud is calling there is this function: https://pandas.pydata.org/docs/reference/api/pandas.Timestamp.strftime.html#pandas.Timestamp.strftime So if your dataframe has a timestamp index it would be definitely available.

sebnapi avatar Sep 09 '23 08:09 sebnapi

@RitwikGhoshLives I ran into the same issue, I think it depends what kind of Index pandas creates. I replaced the line with:

df['date_str'] = [d.strftime("%Y-%m-%d %H:%M") for d in df.index]

This way it works always.

sebnapi avatar Sep 21 '23 16:09 sebnapi