I think that you need to analyse the cross correlations between the series (this show the correlation at different lags) . These statistics assume that the time series are stationary.
Obviously, an appropriate test in the case of correlated trends require careful setting of the model. A first idea to follow is to devide both series into the trend and the perturbating parts; and then perform standard correlation procedure of the trends and separately of the perturbations.
Dear Sir, I expected this question. More covenient for me but obviously not polite would be to return with a question: and what is the trend? But one can easily guess that this is the average. Thus, to be more concrete: If the sequence of observations of one of the series - say ...,x(-1),x0,x1,x2,. . . has a trend which you are detecting by some averaging procedure, e.g. by moving arithmetic mean
then I will call the differences xk - xavk , k=... -2,-1,0,1,2,3,... a pertubation process and the averages xavk a trend process. Next you can analyse the two processes for the x-coordinates and the corresponding two for the y-coordinates separately: in particular you can analyse the correlation between xavk and yavk as the core of the process of your interest, and between xk - xavk and yk - yavk as some noise processes, which should be uncorrelated.
All above has associated to me due to your formulation. My imagination worked toward tohe question - what is the role of the trend. My answer is biased by the meaning, that you are interested in seeking the dependence of the core values of y on the core values of x. If this is not he case then, please, forget my ad hoc found algorityhm.
The idea of two time series being correlated seems a simple enough question.
However, there are some complications, in the question itself.
Are you interested in the deep (primary tread) that might be found with a simple curve fitting tool?... by simple tool I mean one that only picks up and models the main trend.
Or are you more interested in the variation from the trend? and if it is rising or falling and or becoming more or less variable over time?.
these are all auto correlated effects, but do impact the correlation of the two series.
Or are you interested in relative timings of events represented in the series?
this involves some processing before assessment, and I am not sure if correlations are the correct approach here.
Only then can you think about what things do you want to look at for correlation.
Because it is always possible to do correlations, in fact it is probably never really inappropriate for long series to compare them. But it might not be helpful depending on your research objective, to just look at one component without thinking about the phenomena you are studying and by this I would tend think beyond just the two variables of interest, to the aspect of difference and similarity you are most interested in.
A deconstruction of the data series to trend, noise/seasonality, and change in noise is a useful EDA task.
I understand this doesn't answer your question :).