How do arrays get shifted?

 

Attached is a program I am working on. My first one. :-) I have comments in the prog about my problem. I also have a comment on the screen for bebugging.

dRegBuffer is the indicator buffer.

The problem is that dRegBuffer[0] and dRegBuffer[1] are always the same number. I am trying to get the new calc in dRegBuffer[0] and leave the rest of it alone.

I think it has to do with when dRegBuffer gets indexed...maybe????

Note that I am not making any calcs on the current bar. The object is to get the past data to point to the potential high of the current bar.

This prog is ONLY for EURUSD 15 minute.

When a new bar comes in it does calculate to the old bar....too late!

Thanks for any ideas in advance, Jim

Reason: