I am sending you my bot written in MQL5 along with the indicator(HEKENSSS), but the bot is not opening positions due to error 4756. The bot is trying to open positions at the right moment, but this error occurs. When I open a position manually, everything works fine, and other bots function as expected, only this one is not working.
Files:
HEKENSSS.mq5
15 kb
bot.mq5
10 kb
This error is "unsupported filling mode" - it means that the selected filling mode is not supported by your broker- but as you've not explicitly set the filling mode, the default is not accepted.
Search "unsupported filling mode" on mql5.com and you'll find many threads.
A simple fix might be to add: request.type_filling = ORDER_FILLING_IOC; or request.type_filling = ORDER_FILLING_FOK; and see which one works on your demo account.
A more generic solution is to use SymbolInfoInteger(_Symbol, SYMBOL_FILLING_MODE); and select a supported mode.
This thread might help: Order filling type problem. Help? - Trading Hours - Expert Advisors and Automated Trading - MQL5 programming forum

Order filling type problem. Help?
- 2023.10.25
- rrsch
- www.mql5.com
Hey gang, I've been at this one for a couple hours with no success yet. I've tried 2 brokers so far with the EA I'm porting over from MT4...

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 everyone,
I’m working on creating an Expert Advisor (EA) in MT5 that uses the Heiken Ashi Smoothed indicator. Here's what I want the EA to do:
I’m new to coding EAs and need help with the following:
If anyone has experience with something similar or can point me to useful tutorials or resources, I’d greatly appreciate it!
Thanks for your help!