What I want: I would like to save the 'Open' value of each bar in a SQL Server Database. The database connection is working so thats not the problem. However: onUpdateBar() triggers on each tick of these bars, so my indicator is saving the same 'Open' value multiple times during the creation of the bar.
I would like the 'Open' value to be saved just once, and not each tick.
I would like to avoid checking the database each tick to see if I've already saved the open value. I'm using 50+ instruments so that would cause tremendous database load.
Is there anyway to let a piece of NinjaScript code just fire once, on the first tick of a bar?
Comment