I have a question about recalling the number of the bar where an order was placed in Ninjascript. Let's say I submit an order at bar number 100 based on a certain condition. After that, I need to know the number of the bar where the order was placed (i.e., 100) at every subsequent bar.
Right now, I'm using a for loop to check this condition at all previous bars and find the bar where the condition was met. However, I'm wondering if there's a smarter way to do this. Is it possible to move the information about the order's bar to the next bars so that I can easily retrieve it without having to search through all previous bars?
Thanks for your help!

Comment