Yeah, cron jobs should be enough but data points should be on every movement for that period.
If you start with 100 XLM, trade all for XYZ and make a 50% gain, then you deposit 1000 XLM more it will get messy. So for every transaction there should be a profit calc and then aggregated by the cron job by day/week/month/year.
Select sum(profit) from trades where user=:id and time between :ini and :end
Open trades should be calculated on current prices at the moment of the job. ROI should be calculated on XLM value as our quote asset, perhaps in USD too?.
So if you have closed three trades (sold XYZ back to XLM) with profits in the 20%, 15% and -5% you currently have a 30% ROI and if you have an open trade for XYZ then that last movement will be calculated as a probable profit/loss according to the last XYZ price. If the price is down -5% then your total ROI up to the cut-off is 25% but if the price is up another 10% then your ROI is 40%. Unless we don't consider open trades in the calculations, but if I buy all my stash in XYZ at the beginning of year and never move it just watching it grow up to 75% right now, what is my ROI? Zero?