I'm still a newbie at pine script, I have an indicator in version 5, which places a buy arrow marker at a bar that meets my criteria to buy at that point. I then have some criteria that place a sell arrow at a bar that meets those. I would like to keep track of the buy bar id, so I could add a condition to my sell criteria if the current price drops below the buy price. I am not using Trading View to trade, just to give me these marks. A follow up question: how could I get the exact price and record it, at which my buy bar generated the buy signal, as obviously it may have been a long bar, and at some point in it my conditions for buy signal were met. In this way I could just use the drop in price from my buy signal as one of the conditions to sell.
Hope this makes sense, and thank you in advance for any help