Only the signal on the 0th bar is important for Expert Advisors and opening trades, isn't it? So, shorten the calculation cycle from the number of bars to the number required for this calculation
ilunga: For your Expert Advisor and to open trades, the only thing that matters is the signal on the 0th bar, isn't it? So, shorten the calculation cycle from the number of bars to the number needed for this calculation
I tried to open orders on a new bar there using the NewBar() function. If it is used for this purpose?
For example if (NewBar())i++; Something like this.
ilunga: For your Expert Advisor and trade opening it is only the signal on the 0th bar that matters, isn't it? So shorten the calculation cycle from the number of bars to the number required for this calculation
And I still do not quite understand what the fundamental difference between these two calculations is for an Expert Advisor;(
TarasBY: Maybe the array was not prepared correctly in the indicator init()? Did I understand you correctly - the imported function did not work there?
No, it didn't. I checked it, everything seems to be correct. And in addition, why does it work correctly when it is used in the program?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
indicator code, everything works. Here is the library code.
This is a call in the indicator code:
I do not know how to use it.
Z.I. I am sure there are a lot of mistakes and stupid, please shoot blanks.
You yourself write that you have an Expert Advisor and the function is for an indicator.
Count the number of bars you want forcibly and no more.
Secondly, add a check that there has already been an opening by this signal or you will get a new order every tick.
Third, check the iCustom function
You yourself write that you have an Expert Advisor, and the function is for an indicator.
Count the number of bars you want forcibly and no more.
I do not know how to use it.
Z.I. I'm sure there are a lot of mistakes and stupid, please shoot blanks.
Opening price
How do you force a count?
Opening price
I.e. use this condition for recalculation of bars?
But in my indicator, at every tick the arrays TP_UP and TP_DN are calculated.Therefore, we should calculate them first of all.
For your Expert Advisor and to open trades, the only thing that matters is the signal on the 0th bar, isn't it? So, shorten the calculation cycle from the number of bars to the number needed for this calculation
I tried to open orders on a new bar there using the NewBar() function. If it is used for this purpose?
For example if (NewBar())i++; Something like this.
For your Expert Advisor and trade opening it is only the signal on the 0th bar that matters, isn't it? So shorten the calculation cycle from the number of bars to the number required for this calculation
indicator code, everything works. Here is the library code.
This is a call in the indicator code:
Maybe the array was not prepared correctly in the indicator init()? Did I understand you correctly - the imported function did not work there?