How to convert this shadertoy to UE4? The bufferB use itself

I try to use randertarget and event tick to create a loop in shader ,but it didn’t work corretly . looks like only last frame get the second to last frame, the second to last frame didn’t have the third to last frame and before all the others Information.
Sorry My English is not good, can someone teach me how to solve this