2

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?

Tuor
  • 875
  • 1
  • 8
  • 32

1 Answers1

2

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)
vitruvius
  • 15,740
  • 3
  • 16
  • 26