Help me coding the logic in Pi

Hi,

Could you pls. help me coding the following in Pi.

Buy :
When the price will touch the high of the first 15 min. candle (at 9:30 AM). Buy price will be .01% more than the high price. That means the system should place a SL order at the price more than 0.1% of the first 15 min. candle high.

close:
When the price will touch 0.5% more

Sell:

When the price will touch the low of the first 15 min. candle (9:30 AM). Sell price will be .01% less than the low price. That means the system should place a SL order at the price less than 0.1% of the first 15 min. candle low.

Close:
When the price will touch 0.5% less.

Thanks in advance,

Dipankar Nag

Buy Script:

LAST>REF(HIGH,1)*1.0001

Buy Exit:

LAST>REF(HIGH,1)*1.005

Sell Script:

LAST<REF(LOW,1)*1.0001

Sell Exit:

LAST<REF(LOW,1)*1.001

Many thanks for your help. I will run the script and will let you know whether it is working fine or not.