isaiahbjork / Auto-GPT-MetaTrader-Plugin

The AutoGPT MetaTrader Plugin is a software tool that enables traders to connect their MetaTrader 4 or 5 trading account to Auto-GPT.
https://github.com/isaiahbjork/Auto-GPT-MetaTrader-Plugin
MIT License
464 stars 82 forks source link

Error fetching candlestick data for GBPUSD pair in TraderGPT #4

Closed mo-bay closed 1 year ago

mo-bay commented 1 year ago

Description: I encountered an error while trying to fetch candlestick data for the GBPUSD pair using the TraderGPT, an AI-powered trader that performs technical analysis. The error seems to be related to the connection to the API.

Details:

Error Message: Error: HTTPSConnectionPool(host='mt-market-data-client-api-v1.new-york.agiliumtrade.ai', port=443): Max retries exceeded with url: /users/current/accounts/45826ed7-e48f-4d9f-941f-41e7a3d71310/historical-market-data/symbols/GBPUSD/timeframes/1h/candles?limit=15 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x1277f4b50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

Steps to reproduce:

  1. Use the 'fetch_candlesticks' command to retrieve the data for the GBPUSD pair with the following arguments: {'symbol': 'GBPUSD', 'timeframe': '1h'}.
  2. Authorize the command.
  3. Observe the error message.

Expected behavior: The 'fetch_candlesticks' command should successfully retrieve the candlestick data for the GBPUSD pair without any errors.

Additional context: Please let me know if any additional information is required to diagnose or resolve this issue. Thank you!

mo-bay commented 1 year ago

I found the issue causing the error:

url = f"https://mt-market-data-client-api-v1.new-york.agiliumtrade.ai/users/current/accounts/{account_id}/historical-market-data/symbols/{symbol}/timeframes/{timeframe}/candles?limit=15" It turns out that my API access was for the London region, but the code was attempting to connect to the New York region. I resolved the problem by replicating my API to the New York region.

If you are experiencing the same issue, please try replicating your MetaAPI access to the New York region to fix it.

mo-bay commented 1 year ago

p.s. it seems that the newyork api is facing outages, i edited the code and replaced all api endpoint to london in personal repo

isaiahbjork commented 1 year ago

p.s. it seems that the newyork api is facing outages, i edited the code and replaced all api endpoint to london in personal repo

I will make changes for you to set your own region in the .env

GameWorldsLLC commented 1 year ago

you have to have metatrader open and then i had to also tell my agent/ AutoGPt that i had metatrader open and the internet was ok. after i did that everything started working