Buy Nifty and put order above 10 points
if nifty goes down buy same quantity equal to holding quantity average the price and then remove old execution order and put new order for total quantity 10 points above average
continue the process till order gets executed
Automating Order Placing is not Supported on Pi at the moment.