simple price move

 

Hi everyone,

 

i'm completely new to coding, just an old fool with an embarrassingly basic question. Would anybody spare a few moments on explaining how to make a simple script that 

A:  Opens position 

B: If Price moves 50 pips in the opposite direction CLOSE and REVERSE

C: LOOP

 

Much obliged,

Dave