Comments (6)
As I explained here, you can override the download_data
method and load your own dataframes. It's a bit more complicated than anytrading. For each symbol, you should load a dataframe and specify its SymbolInfo
. The symbol info is required for precise calculations. Currently, it is filled by retrieving the information from MetaTrader but you can create an instance of this class and fill it manually.
from gym-mtsim.
@AminHP
Hi Amin, I probably know what to do next, but it's a little different from what I expected. I thought I should rewrite the load_symbols method to load my own df. So what's the difference between the download_data() and load_symbols()?
According to their source code, the load_symbols method is loaded from a filename:str(actually a path), which seems to be more in line with my requirements?
def download_data(
self, symbols: List[str], time_range: Tuple[datetime, datetime], timeframe: Timeframe
) -> None:
from_dt, to_dt = time_range
for symbol in symbols:
si, df = retrieve_data(symbol, from_dt, to_dt, timeframe)
self.symbols_info[symbol] = si
self.symbols_data[symbol] = df
def load_symbols(self, filename: str) -> bool:
if not os.path.exists(filename):
return False
with open(filename, 'rb') as file:
self.symbols_info, self.symbols_data = pickle.load(file)
return True
from gym-mtsim.
The load_symbols
method can only load a file which was previously saved by the save_symbols
method. And the save_symbols
should be called after filling the simulator.symbols_info
and simulator.symbols_data
attributes. These attributes are filled in the download_data
. So, in order to make load_symbols
work correctly, the proper data should be provided first in the download_data
method.
from gym-mtsim.
oh, that's clear, thanks!
from gym-mtsim.
May I ask, How can I fix trading volume or lot size?
thanks in advance for your answer
from gym-mtsim.
oh, that's clear, thanks!
please can you share your notebook to upload custom data file
from gym-mtsim.
Related Issues (20)
- Possible to train the bot on 1H or 4H instead of D1? HOT 4
- How can I add technical indicators ? HOT 1
- example: environment with custom parameters HOT 3
- is it possible to use this code to live trading via MT5? HOT 2
- pyfolio HOT 2
- Should use open price instead of close price HOT 2
- AssertionError: Continuous action space must have a finite lower and upper bound HOT 4
- Check if market is closed HOT 3
- Incompatibility with Linux systems HOT 2
- Feature Request: update from gym to gymnasium HOT 3
- Set lots(volume) HOT 3
- Fee is not the same as spread HOT 1
- The new models and the issues caused by signal_features. HOT 1
- Error running using the environment HOT 4
- A question about calculate balance HOT 3
- Composite Spaces HOT 1
- Error, with only import HOT 2
- The example provided using the same dataset for learning and testing?
- TypeError: MtSimulator._create_hedged_order() missing 1 required positional argument: 'raise_exception'
- can add yolo model to the env
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gym-mtsim.