Need a code for my crossover strategy

 Please give me the code for my strategy to back-test on pi.

  Buy on EMA (5,34) CROSSOVER (EMA 5 crosses EMA 34 upwards)

  Buy Target is variable (say "x')  from entry price

Position Exit -- Either on target hit or at next EMA (5,34) CROSSOVER (EMA 5 crosses EMA 34 downwards)

Sell on EMA (5,34) crossover (EMA 5 crosses EMA 34 downwards)
  Sell Target is variable (say "x')  from entry price

Position Exit -- Either on target hit or at next EMA (5,34) CROSSOVER  (EMA 5 crosses EMA 34 upwards)

Waiting for a quick and positive reponse.Thanks in advance.

As per the above condition 

BuyScript:

CROSSOVER(EMA(CLOSE,5),EMA(CLOSE,34))

SellScript:

CROSSOVER(EMA(CLOSE,34),EMA(CLOSE,5))

Thanks a lot :smiley: