It's not clear to me why ALLBARS, rather than NEWBAR...which is what I suspect you really want to do. Examples of using pop and unshift or shirft and push with NEWBAR abound...but they are not always doing the same things.
Go to the file share, and downloan Gator.efs from Chris D. Kryza's diretory. It is pretty striaght forward script, and uses unshift and pop at NEWBAR.
If you describe more of what you are trying to do, I may be able to be of more help.
The use of if BARSTATE_ALLBARS is only true one during initial load and subsequent reload, which as Garth indicated, not appropriate for filling arrays. Here is a link
Comment