Quote:
Originally Posted by wolfe
Hello everyone,
This is a stupid coding question, and I know I've seen it somewhere before, but I need help.
I'm coding a custom indicator, and all I want it to do is read the current bid price at ONLY THE BEGINNING of a NEW bar. I can't just use Open[0] because every time a new tick comes in it will keep returning the open value for the current bar. I want the value to be returned only once, until a new bar is formed.
I know I'm missing something quite simple here, but am having a bit of trouble figuring it out. Could someone help me?
Thanks,
-wolfe
|
Just store the current bar time (Time[0]) - when this value changes, you have a new bar, so get your price, store new value and repeat...