Help required with simple trading sytem

 

Hi all

Help required with simple trading system hope this make sense

1, Buy current bar open plus percentage of previous days range on stop limit
2, Only by if current BAR ATR is les than Previous 4 Bars
3, Exit On Close

User settings

A, Percentage of previous days range for buys
B, Percentage of Previous day range for Shorts
C, ATR stop period
D Stop Loss

Thanks all in advance help required to code this trading system

Peter