Looking For a (Non-TG) SF Story

Since there are a lot of science fiction fans here, I'm hoping that one of them may be able to tell me the author and title of a short story I read years ago in an anthology. FWIW, it was the last story in that book, introduced by the editor's comment that the author enjoys playing around with story structure.

My guess is that it's from around 1970, from an American writer. (Jack Vance's name came to mind, but I couldn't find anything that looked like it among his story titles.)

It's in three sections. The first begins with the line "this is the end of the story".

(Or something similar; Googling those words didn't help me). It's a brief section in which we see our hero save his girl and get rewarded with an executive job by her grateful and wealthy father.

The next one, by far the longest, begins, "this is the middle of the story" and begins with our protagonist in a fortune-telling booth at a carnival or some such. The individual in the booth brings us up to date on who the guy is and his situation; he explains to our man that he has a psychic connection to someone from the future that may be able to help him deal with the problem. Our man does so over the rest of the section, getting us (of course) to the point where the final section begins.

Then we get the twist: the beginning of the story. In that future time period, the man our hero was channeling is preparing to go back in time to retrieve his runaway robot. He programs his own arrival to the proper time and place -- and he finds himself in a fortune-telling booth, where the robot somehow wipes his identity and provides him with the name and background that began the middle part.

Anybody here recognize it?

Thanks, Eric