So you could use the by me typed code without any changes??
I didn't use your code, I used mine but added as a value to the function to pass the price of the close like you did. I then called the function in the main loop of the indicator passing as parameter Close[i], and now it's working correctly!thank you!
I didn't use your code, I used mine but added as a value to the function to pass the price of the close like you did. I then called the function in the main loop of the indicator passing as parameter Close[i], and now it's working correctly!thank you!
OK. Thank you.
EDIT:
You should really try to understand my version of the code.
I have another problem with this indicator unfortunately. The code stays the same, and works fine, but if I use an asset where I've already inserted the indicator before, the objects are loaded immediately. But if I insert a new asset, I have to re-insert the indicator several times or do a timeframe switch to make the objects appear. What could this problem be caused by? I thought it was due to creating the objects in the OnCalculate, but I have looked at other open source indicators which are similar and don't have this problem even though the objects are created in the OnCalculate...
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.
I didn't use your code, I used mine but added as a value to the function to pass the price of the close like you did. I then called the function in the main loop of the indicator passing as parameter Close[i], and now it's working correctly!thank you!
I didn't use your code, I used mine but added as a value to the function to pass the price of the close like you did. I then called the function in the main loop of the indicator passing as parameter Close[i], and now it's working correctly!thank you!
Sure, also because it's even more elegant than my code 😃
I thought it was due to creating the objects in the OnCalculate, but I have looked at other open source indicators which are similar and don't have this problem even though the objects are created in the OnCalculate...