Im getting the same error. Let me know if you've found the solution.
AttributeError means that there was an Error that had to do with an Attribute request. In general, when you write x.y, y is the purported attribute of x. NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None. That usually means that an assignment or function call up failed or returned an unexpected result.
mylist = mylist.sort()
The sort() method of a list sorts the list in-place, that is, mylist is modified. But the actual return value of the method is None and not the list sorted. So you've just assigned None to mylist. If you next try to do, say, mylist.append(1) Python will give you this error.
I get the same error for some of the symbols. I searched everywhere and I don't see any solution. Maybe someone help?
My code was working fine until last Thursday.
But last Thursday, this error 'suddenly started coming back and I haven't been able to solve it yet.
Can someone tell me how to solve it?
The code is as following:
result = mt5.order_send(request)
result_dict=result._asdict()
The mt5 returns 'None' as result above.
So
AttributeError: 'NoneType' object has no attribute '_asdict'
was comming back.
But this code was working until when it occured.
Please let me know the solution.
This issue has been resolved.
The reason the 'None' was returned by mt5 was the 'volume' in the 'request' was not a float but an integer.
Thank you.
Solution found: Plese check you send_order function and pass the correct type of arguments as required
res = send_order(symbol, lot, True, False,pct_tp=pct_tp, pct_sl=pct_sl)
print(f"OPEN BUY POSITION: {res.comment}")

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hi guys, i keep getting an AttributeError with my code, does anyone know how to fix it, it has got be stumped.
any support would be great.