EA to scale in and out of trades

 

Does anyone have an EA that will scale in and out of trades? It seems very simple but I do not know how to code. I am looking for the following operation:

Open Position

If Price Increases (X)

Then Sell (Y lots)

If Price Decreases (X)

Then Buy (Y lots)

Where X = number of pips

and Y=portion of open position

Does anyone have code that will do this or know where I can find it in the forum?

Thank you for any assistance you can provide.

Best Regards,

Mike