Need PI Code for below strategy

BUY: when stock CMP (+0 .1%) from previous day high for target 1% with sl of 0.25%

Exam. If Prev day high 100 , CMP 98 wish to Buy at 100.1, Book profit @ 101 and stop loss is 99.75

Short when stock CMP (-0 .1%) from previous day low for target 1% with sl of 0.25%

Exam. If Prev day low 100 cmp 103 wish to short at 99.9, Book profit @ 99 and stop loss is 100.25

it is not possible to define exactly beased on % in tradescript you can use price alert indicator and define the price https://zerodha.com/expert-advisors/code/price-alert-indicator