This time hopefully I have checked all possible ways CopyBuffer can return something invalid. (unlike last time, when I neglected to GetLastError). Still, in rare cases, CopyBuffer sometimes writes rogue values to its destination array. This little script, though pointless on its own, proves it. 1
I have reduced a bug in an indicator I am working on to a reproducible case of unexpected behavior with CopyClose. #property indicator_separate_window #property indicator_buffers 0 #property indicator_plots 0 int OnInit () { IndicatorSetString ( INDICATOR_SHORTNAME , "copyclose_bug_demo" );