I might be missing something in your question but if you want to know if a new bar has arrived, you could just check the value of barindex?
LastBar = LastValue(BarIndex(
));
prevLastBar = StaticVarGet("prevlastbar");
// Initialise
if (IsNull(prevLastBar)){
prevLastBar = LastBar;
StaticVarSet("prevlastbar", prevLastBar);
}
if (LastBar > prevLastBar){
_TRACE("New Bar");
StaticVarSet("prevlastbar", LastBar);
}
Regards,
Jules.
--- In amibroker@xxxxxxxxxps.com, "scourt2000" <stevehite@x..> wrote:
>
>
> Would it be of value to any other real-time traders here (besides me, of course) to have Amibroker automatically notify a script when the 1st tick of a new bar is coming into the script? This way, you don't have to know what kind of bar you're dealing with (minute-based, tick-based, volume-based) and try to do the calc yourself.
>
> I guess it would be something like a toggle trigger that you check in a simple IF condition and that toggle is only entered into on the 1st tick of each new bar.
>
> Just wanted to get an idea of the interest before going through the formal procedure of entering it into the Amibroker wish list area.
>
> Thanks.
>
Windows Live: Keep your friends up to date with what you do online.