I've got a possible interpretation, for which however, I'm afraid there is actually little hard evidence (but considering the scarcity of etymology studies dealing with prostitution professional vocabulary, this is hardly surprising). However if you connect the dots, it kind of makes sense.
For each dot, in the conjecture below, I will add a confidence level (abbreviated as CL), so that hopefully other contributors might fill the gaps.
Here it goes anyway:
It all comes from... Surprise, surprise.... French argot (slung).
- "trique" in popular French is a word
for a wooden stick (CL 100%).
French donkey's are sometimes
motivated using "des coups de
trique". It is believed to come
from Northern French dialectal
"estrique" and is akin to "strike" in
English, "streik" in German and so
on. Also gives "tricoter" (to knit) in French.
- "avoir la trique" or "triquer" means
to have an erection (CL 100%).
Passing the boundary between popular
and argotic here.
- By extension "triquer" or "trequer"
means, for a man to make love, in a
careless/bestial way to his partner.
(CL 100%). Please refer to a
famous novel named "Prostitution"
by Pierre Guyotat, easy to find on
the web. Just Google for "Guyotat
triquer" and you should net a large
number of hits.
- The verb "triquer" used as "to have sex
with a prostitute" was particularly
common in the world of French
prostitution in the previous century
at least (CL 50%). Can't back this
from personal experience, I'm afraid
;-).
- The idiomatic expression passes in the English language somehow (CL 20%).
- A trick in English in the context of
prostitution has both the meaning of
a customer or the act itself. (CL 100%).
- To "turn tricks" is to engage in acts of prostitution with "Johns" or "Tricks".
So you see, this is a possibility but there are a few gaps which I'm not able to fill with certainty.
Edit
Since this post was composed (more than one year ago) and as I researched the world of the French Impressionists, I came across additional info concerning the step in which the expression passes into English.
It is a well documented fact that the French industrial revolution was accompanied as everywhere else, by rural exodus, poverty, and an increase in the levels of urban prostitution. It is also possible to show that a proportion of French prostitutes emigrated to the US and various other destinations (even Australia) at that time (end of the 19th Century). Conversely, one can find examples of "petits femmes de Paris" having risen to a certain level of fame and wealth in the US at the time.
In summary, the possibility that the expression passes into English now seems less conjectural to me.
Since nobody has answered this yet, here's my formalization of the comments. "On end" means "without a break", which has been slightly altered over time so that "days on end" now often means "several days". It is easy to misunderstand this as "days without end", and to wonder about the origin of the phrase. But if you do this, you are committing a solecism of which we are all guilty from time to time; assuming that something you do not know must be related to something you do know. (Is there a name for this, all you linguists?)
So technically the answer is that your questions is based on a false premise, and cannot be answered.
Best Answer
The following is what I've found on the net about this phrase:
I have also found an interesting story about the etymology of the phrase.
(Editorial note: The copied story has been removed because of questionable copyright use. Also, the linked story is a joke and not a true etymology of the phrase.)