Does anyone have experience generating the capital gains "Date Acquired" from a trades (buy/sell) database?
If you have done it before you know what I'm asking. It's a for a cryptocurrency application.
Hint, is there a way to create a relationship based on a key that contains a way to > or < filter, explain:
Date < the current records date + customer + coin + exchange.
In other words, a key that would see every record older than the current records date for the given customer/coin/exchange.?
Do you need to manage the holding period for buy, sell and trade? If you are not doing trades or reinvestments the Date Acquired is just the day after you purchased the instrument, right?
Yes, the date acquired is the last date purchased where the pool is large enough to cover the sell. Data from exchanges comes in a stream of buy and sell sided trade. I am spending today figuring out how to create a relationship from the point in time of the current record, AKA a sell record, and look back, then get the maximum date of a purchase trade that funded the pool enough to to fund the current sell. I am trying to do this without a script in real time. I think most people "run a report" (script) bouncing up and down until they find the last running balance that will fund the current sell to set the date.
Gosh I wish you could edit replies, haha. What might help is a comparative relationship operator but I also need to key down to the customer/currency/exchange, darn might have to create another table, lol.
Retrieving data ...