Find shares which are correlated to nifty today

How to find nifty shares which are moving today in correlation with nifty for each 5 minute tick ?

Can i write a code to do this ?

e.g. nifty has moved up say .01 % in last tick.

Can i know which nifty shares have moved up with nifty during last tick ? If yes, by what percentage.

The above conditions can not be coded , all those are manual. you can check it in nseindia.com

Thanks for the answer.
Is it possible to write code to get up / down pcnt for a few scrips ?
e.g. close = 101 ref(close,1)=100 can I get 1.00 ?