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

Failed to get candlesticks. #10

Open wikbon opened 1 year ago

wikbon commented 1 year ago

Good day to you! I've been wondering about trying out this plugin. I've created all of the requried accounts and entered all of the ids and api keys, but when i try to run it, it always Failed to get candlesticks. I let it run for a few commands and it also throws Error: DataFrame constructor not properly called!. I'm kinda new to github issues, so appologies for poor formatting. Thank you in advance for any help. image

remixxan commented 1 year ago

I have the same issue. It's trying to use google instead. Got it all set up and double checked regarding the installation. Any ideas on what is causing the problem?

` THOUGHTS: I will use the 'fetch_candlesticks' command to fetch GBPUSD 1D data for the last 30 days from MarketWatch. REASONING: I found a link on MarketWatch that allows me to download the data directly. The 'fetch_candlesticks' command is the most appropriate for this task as it allows me to fetch candlestick data for a given symbol and timeframe. PLAN:

toobongo999 commented 1 year ago

I have a similar issue, but took me a while to work out that some currency pairs work. For example:

Metatrader symbols that work: EURGBP, USDJPN, USDSGD, Not working: USDEUR, EURUSD, AUSUSD (Because USDEUR wasn't working, I got it to put the pair as EURUSD to see if that worked, but it didn't.)

I am able able to successfully pull the following: get_account_information get_positions get_stock_of_the_day get_important_forex_news

I am also able to successfully do all of the following for currencies that work: rsi money_flow_index volume ema macd fib_retracements stochastic_oscillator

I can't pull: get_sentiment With SMA, I get 'min_periods must be an integer' but when it then tries to add min periods with an integer it gets an error. Someone else has raised this.

In order to troubleshoot further, it is worth establishing what does work, for example, put the objective as:

To conduct troubleshooting on the MT4 Metatrader API. The aim is just to find what works with the API. It is not to find profitable trading opportunities. Create a file called GPTCurrencyText.txt. Run through the different currency pairs to see which ones work and which ones do not, using the following command: COMMAND = fetch_candlesticks ARGUMENTS = {'symbol': '', 'timeframe': '1h'} but cylcing through each currency pair, including EURGBP, USDJPN, USDSGD, USDEUR, EURUSD, AUSUSD. After each test, store the result in GPTCurrencyText.txt file and move on to the next currency pair.

(I wasn't successful in getting it to generate a file, but it did seem to keep it pretty focused on going through the different pairs.)

Also: To conduct troubleshooting on the MT4 Metatrader API. The aim is just to find what works with the API. It is not to find profitable trading opportunities. Run through the different commands to see which ones work and which ones do not, including the following requests: get_account_information, get_positions, get_stock_of_the_day, get_important_forex_news, get_sentiment

My guess is that there are idiosyncrasies between brokers requiring slightly different syntax, and this is leading to the issues, but further diagnosis needed.

Silas38100 commented 1 year ago

regarding the SMA issue, I modifyed the code in "Indicators.py" as follow and it works !

 def sma(candlesticks, period):
     # Get the candlesticks data
     if candlesticks:
         df = pd.DataFrame(candlesticks, columns=['close'])
         df = df.dropna()
         sma = SMAIndicator(df['close'], window=int(period))  # Convert period to integer
         return f'Current Simple Moving Average Value: {sma.sma_indicator().iloc[-1]}'

     if not candlesticks:
         return 'Failed to get candlesticks'