Jump to content

SZZ

Members
  • Posts

    1
  • Joined

  • Last visited

SZZ's Achievements

1

Reputation

  1. I'm trying to follow the documentation here: https://labs.ig.com/rest-trading-api-reference My goal: I want to open an order via API, get frequent updates via lightstream and a final update when the order is closed, including P&L information. I open the order by putting a request to /gateway/deal/positions/otc v2. This works and returns a deal id and a deal reference Then I confirm the order by deal id using /gateway/deal/confirms/ v1. This also works. I also get updates via the lightstream API on the trade type OPU with the status OPEN and DELETED when the order is closed. Again, the DealId and the Reference match. But the DELETED update does not contain a P&L information. So on DELETE I access the activity transaction history by deal ID: /gateway/deal/history/activity v3. This also works, but also does not contain P&L, but therefore a description with a new Id, reading "Position opened: [some id]". This id consits of the last part of the DealId. Afterwards, I access the transaction history on /gateway/deal/history/transactions v2. Here I finally have a P&L, but the reference field contains a new reference that never showed up before. There is just no way to link the transaction to the activity or to an order. So the question: Is there any way to get P&L information on a closed position based on deal Id or deal reference? I really don't want to match opening date and epic name, that's just bad practice.
×
×
  • Create New...
us