Discussion of article "Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners" - page 20

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
So, I have now rebuilt the EA.
Of course it's notprofitable, but at least it's readable (for me).
Good luck with continuing with it.
So, I have now rebuilt the EA.
Of course it's not profitable, but at least it's readable (for me).
Good luck with continuing with it.
THANK YOU VERY MUCH FOR THAT!
Say goodbye to my notebook-free holiday for now
Hi, I'm new, great guide, thank you!
I have a problem though. I compiled the provided example, ran through the debugger, the break points worked, resumed the debugging and I get 4756 errors on both buy and sell orders, like this:
What may be happening and what should I look into to correct this behaviour?
V.
It's a bug in the EA. Take a look at page 2 where the solution is.
Better approach: use https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade class.
The EA is opening many positions both buy and sell.
best way to correct it is This:
if(Buy_Condition_1 && Buy_Condition_2)
{
if(Buy_Condition_3 && Buy_Condition_4)
{
// any opened Buy position?
if(Buy_opened || Sell_opened)
{
Alert("We already have a open Position!!!");
return; // Don't open a new Buy Position
}
---------------The same is applicable to the sell position-----------------------
The original code under opens multiple positions:
if(Buy_Condition_1 && Buy_Condition_2)
{
if(Buy_Condition_3 && Buy_Condition_4)
{
// any opened Buy position?
if(Buy_opened ) //Error, should be: if(Buy_opened || Sell_opened)
Alert("We already have a open Position!!!");
return; // Don't open a new Buy Position
}
Please edit your post and use the code button (Alt + S) when posting code.
What start, end and step values do I use?
Can I use genetic optimisation?
It's a bug in the EA. Take a look at page 2 where the solution is.
Better approach: use https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade class.
I'v got 4756 error, I saw the solution in page 2, and I checked orginal code, there was ZeroMemory(mrequest); in line 218 itself. but I have still the error 4756.
Could someone help me with optimising the EA?
What start, end and step values do I use?
Can I use genetic optimisation?
Hello my friend, I'm a beginner too but there's a YouTube channel that has helped me a lot with optimisation, the Vilela channel!
I've found a lot of useful stuff there with excellent teaching. Can I chat to you so we can exchange experiences?
good studies!!!