Questions from Beginners MQL4 MT4 MetaTrader 4 - page 176
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
Guys, help me fix the EA. Instead of checking orders, it will buy without stopping, at the first signal, until it spends the entire deposit. Thank you all in advance
Guys, help me fix the EA. Instead of checking orders, it will buy without stopping, at the first signal, until it spends the entire deposit. Thank you all in advance.
The code can be formatted normally right in the code editor using the code styler: Ctrl + <
I formatted it for you - now it's normally readable.
Guys, help me fix the EA. Instead of checking orders, it will buy without stopping, at the first signal, until it spends the entire deposit. Thank you all in advance.
You have identified it correctly, the error is in the check positions function
I have highlighted in red, fixed.
I have corrected it.
You have correctly identified the error in the position checking functions
red highlighted, corrected.
That's about it.
Fixed it, it's still the same. The problem is still there.
did you copy all the code in there?
Did you copy all the code in there?
I didn't copy all the code by mistake. It's ok there return(count);
}
That's how the code ends, as it should. There are no errors and warnings at all when compiling the code. I must have made a mistake in the functions, I cannot figure out where. I fixed it as I was told above. I also have no errors, but the adviser itself works the same way (the first signal, it buys for the entire deposit, given lots, such as 1 lot set and he buys 1 lot of deals 200 or more, as long as the deposit is enough. But the signal is correct, buys also correctly, only a lot)
I didn't copy the whole code by mistake. It's fine return(count);
}
That's how the code ends, as it should. There are no errors and warnings at all when compiling. I must have made a mistake in the functions, I cannot figure out where. I fixed it as I was told above. I also have no errors, but the adviser itself works the same way (the first signal, it buys for the entire deposit, given lots, such as 1 lot set and he buys 1 lot of deals 200 or more, as long as the deposit is enough. But the signal is correct, buys also correctly, but a lot)
I have checked and corrected it.
How to find number of candles between dates?
if the TF is synchronised then any CopyXXXX() function :
Referencing the start and end dates of the required time interval
intCopyTime(
stringsymbol_name,// symbol name
ENUM_TIMEFRAMEStimeframe,// period
datetimestart_time,// from which date
datetimestop_time,// till what date
datetimetime_array[]//array to copy opening time
);
Returned value
Number of copied array elements or -1 in case of error.
you can use iBarShift() to find 2 bars by time
if the TF is synchronised then any CopyXXXX() function :
Referencing the start and end dates of the required time interval
intCopyTime(
stringsymbol_name,// symbol name
ENUM_TIMEFRAMEStimeframe,// period
datetimestart_time,//from what date
datetimestop_time,// till what date
datetimetime_array[]//array to copy opening time
);
Returned value
Number of copied array elements or -1 in case of error.