I buy 10,000 shares of ASTC using a broker API.
The order is filled in 4 similar lots;
2500 shares at 0.80 2500 shares at 0.80 2500 shares at 0.77 2500 shares at 0.77
The easiest way to record these lot fills is if the broker issues a UNIQUE "Lot ID" like this:
2500 shares at 0.80 --- LOT ID# 3484HGK 2500 shares at 0.80 --- LOT ID# DFD38HF 2500 shares at 0.77 --- LOT ID# JJVKD89 2500 shares at 0.77 --- LOT ID# FJF9D93
Unfortunately, the broker does not issue LOT ID#'s (yet). A computer program will see the lot fills many times.
WHAT LOGIC DO I USE TO PREVENT THE PROGRAM FROM RECORDING EACH LOT FILL MORE THAN ONCE?
Suggestion 1: I can make a hash based on the attributes of the LOT. That may work, however, if everything matches (timestamp, number of shares, symbol, price) I will get duplicate hashes.
Suggestion 2: Use the alert notifications. I am not sure the notifications are available from the API.
I would like to know how others have handled this tracking issue.