Ichinga-Samuel / aiomql

Asynchronous Python Library For MetaTrader 5
MIT License
51 stars 14 forks source link

error #2

Closed kamranshalilian closed 1 year ago

kamranshalilian commented 1 year ago

hey my friend, I ran this code and that had error

def build_bot():
    bot = Bot()
    st = FingerTrap(symbol=ForexSymbol(name='EURUSD'))
    st1 = FingerTrap(symbol=ForexSymbol(name='GBPUSD'))
    st3 = FingerTrap(symbol=ForexSymbol(name='EURGBP'))
    st4 = FingerTrap(symbol=ForexSymbol(name='EURAUD'))
    bot.add_strategies([st1, st, st3, st4])
    bot.execute()

build_bot()

error :

No Config File Found No Config File Found No Config File Found No Config File Found EURGBP not a available for this market EURAUD not a available for this market EURUSD not a available for this market GBPUSD not a available for this market Trading EURUSD Trading EURAUD 'NoneType' object has no attribute 'data'. Error in FingerTrap.check_trend 'NoneType' object has no attribute 'data'. Error in FingerTrap.check_trend 'NoneType' object has no attribute 'data'. Error in FingerTrap.confirm_trend 'NoneType' object has no attribute 'data'. Error in FingerTrap.confirm_trend 'NoneType' object has no attribute 'data'. Error in FingerTrap.check_trend 'NoneType' object has no attribute 'data'. Error in FingerTrap.check_trend 'NoneType' object has no attribute 'data'. Error in FingerTrap.confirm_trend 'NoneType' object has no attribute 'data'. Error in FingerTrap.confirm_trend

Ichinga-Samuel commented 1 year ago

Ensure you have a file called aiomql.json in your project directory with the login, server, and password details of your broker.

Alternatively, you can instantiate the Account singleton class with your login details.

from aiomql.account import Account
  Account(login=login, password=password, server=server)
# call this before executing the bot.

Ideally, your code should stop running if you can't log in properly to MetaTrader 5. I will try to reproduce this error to see why the program did not exit.