I am trying to see if the most recent two bars have the same high while the current bar is not closed yet. But, when I use statements like the following,
if( (High[0]==High[-1])){
PlaySound(@"C:\Windows\media\notify.wav");
}
the sound is played after the most recent bar is closed and the current bar is still going (not closed). And, in those cases, the current bar and the most recent bar still close with the same high. Any thoughts on why it would do that? Or how could I correctly code to achieve the desired results?
Thanks.
Comment