Find position entry price from ID

Viewed 104

In Pine, if I made some strategy.order on a previous bar, with id "order ID", is there a function to retreive the entry price of that order on a later bar?

1 Answers

You can use strategy.closedtrades.entry_price or strategy.opentrades.entry_price.

// Return the entry price for the latest  entry.
entryPrice = strategy.closedtrades.entry_price(strategy.closedtrades - 1)
Related