Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sim.download_data report error #15

Closed
0trade opened this issue Dec 9, 2021 · 2 comments
Closed

sim.download_data report error #15

0trade opened this issue Dec 9, 2021 · 2 comments

Comments

@0trade
Copy link

0trade commented Dec 9, 2021

Code:

sim = MtSimulator(
    unit='USD',
    balance=10000.,
    leverage=100.,
    stop_out_level=0.2,
    hedge=False,
)


sim.download_data(
    symbols=['EURUSD', 'GBPCAD', 'GBPUSD', 'USDCAD', 'USDCHF', 'GBPJPY', 'XAUUSD'],
    time_range=(
        datetime(2021, 5, 5, tzinfo=pytz.UTC),
        datetime(2021, 12, 5, tzinfo=pytz.UTC)
    ),
    timeframe=Timeframe.M5
)
sim.save_symbols("C:\\symbol.pkl")

Error:

  File "test.py", line 15, in <module>
    sim.download_data(
  File "D:\Porjects\rlmt\gym-mtsim-main\gym_mtsim\simulator\mt_simulator.py", line 59, in download_data
    si, df = retrieve_data(symbol, from_dt, to_dt, timeframe)
  File "D:\Porjects\rlmt\gym-mtsim-main\gym_mtsim\metatrader\api.py", line 20, in retrieve_data
    symbol_info = _get_symbol_info(symbol)
  File "D:\Porjects\rlmt\gym-mtsim-main\gym_mtsim\metatrader\api.py", line 53, in _get_symbol_info
    symbol_info = SymbolInfo(info)
  File "D:\Porjects\rlmt\gym-mtsim-main\gym_mtsim\metatrader\symbol.py", line 9, in __init__
    self.name: str = info.name
AttributeError: 'NoneType' object has no attribute 'name'
@AminHP
Copy link
Owner

AminHP commented Dec 16, 2021

Sorry I missed your issue.

It seems like a network problem. Do you still get this error?

@0trade
Copy link
Author

0trade commented Dec 23, 2021

You are correct.

I changed the network and It's worked.

Thank you sir.

@0trade 0trade closed this as completed Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants