Matching stock return dates (Mo-Fr) with sentiment (daily) - join two datasets
Dear community,
I am doing a sentiment analysis on stock returns on the example of a specific company.
Now I am looking for the easiest way to match my sentiment measures with the firm-specific stock prices.
As Xetra is only open Monday through Friday with exception of national holidays, I want to average my sentiment measure on non-consecutive market days.
In essence I count the number of positive and negative words for firm-specific news and normalize them by the total number of words. I do that for all consecutive trading days but on non-consecutive market days I want to average all articles published from close to open.
Can a join operator do something like this automatically, meaning just pasting the measure when a stock price is available and averaging it and writing it to the next opening day when no matching date is available?
Thanks a lot for your help!