AminHP / gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)
MIT License
2.09k stars 459 forks source link

Leverage #54

Closed sadimoodi closed 2 years ago

sadimoodi commented 2 years ago

Hello, Thanks for the outstanding library! May i ask if the library can provide the functionality for a leverage (example: 10x)? I went through the code and i could see that you are only using the margin concept.

AminHP commented 2 years ago

Hi @sadimoodi , Thanks :)

Did you check out my new project? It is a complete environment supporting all the requirements for real-world trading.

https://github.com/AminHP/gym-mtsim

yglpyn8888 commented 2 years ago

Hi @sadimoodi , Thanks :)

Did you check out my new project? It is a complete environment supporting all the requirements for real-world trading.

https://github.com/AminHP/gym-mtsim

Hi, I am a trader and only trade in the futures market, and I never use MT5 platform. I use python platform to support the whole process of my trading (training rl model , get tickdata from exchanges, sending orders , etc.. ). Should I use gym-anytrading or gym-mtsim to train my agent? Is there any functional in gym-mtsim environment that is not supported by gym-anytrading? Thanks.

AminHP commented 2 years ago

Hi @yglpyn8888

MtSim calculates profit precisely according to real-world markets. It considers everything, such as margin, equity, margin level, etc. Besides, it has a high detail visualization that helps debug RL/classic algorithms better. But it is kind of complex and takes time to get familiar with. I suggest you start with anytrading and switch to mtsim whenever you feel like it does not meet your needs and a more precise real-world tool is required.

yglpyn8888 commented 2 years ago

@AminHP Thanks for reply , i understand mtsim is more precise than anytrading. but i focus on, does MtSim supposed to work with MT5 together? If I don't use MT5, can I use MtSim to train my agent?

AminHP commented 2 years ago

@yglpyn8888 Not necessarily. It can work without MT5 by some modifications. You can override the download_data method and load your own data frames or download data from other platforms. Just make sure the structure of the new data matches the current one.