Hello,
find below a smal ea which demonstrates the problem: When using CopyOpen and CopyClose, values of open and close of last index (highest) always identical.
Can anyone explain why this is so, or what's the sense or is there a mistake in the code.
Thanks in advance
Open[minbarcount-1] and Close[minbarcount-1] are the values of open and close for the current bar (the last bar in the chart). As your code is only executed when there is a new bar Open=Close (and also =High=Low).
I also draw your attention to the fact that it is not reliable to use Bars () to detect a new candle/bar.
Open[minbarcount-1] and Close[minbarcount-1] are the values of open and close for the current bar (the last bar in the chart). As your code is only executed when there is a new bar Open=Close (and also =High=Low).
I also draw your attention to the fact that it is not reliable to use Bars () to detect a new candle/bar.
Thanks. God explanation. Makes sense.
So what do you suggest to detect new bar ? Obiviously it works, when open and close always same for latest...?
Thanks. God explanation. Makes sense.
So what do you suggest to detect new bar ? Obiviously it works, when open and close always same for latest...?
Thank you for code. You are a living manual.
Thank you, but to be honest I was just reading an article on this subject when I saw your question ;-)
But please do not understand this wrong. I do not expect other people to search for me.
My hope is always somebody has a solution in mind or minds a ->direct<- link to an article where this problem was discussed or solved.
But please do not understand this wrong. I do not expect other people to search for me.
My hope is always somebody has a solution in mind or minds a ->direct<- link to an article where this problem was discussed or solved.
Don't worry, ask your questions. So if I think it is easy to find I will send you packing ;-)
Thank you angevoyageur. Right now, having next issue.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
find below a smal ea which demonstrates the problem: When using CopyOpen and CopyClose, values of open and close of last index (highest) always identical.
Can anyone explain why this is so, or what's the sense or is there a mistake in the code.
Thanks in advance