Scrip code for my strategy

please help me to write a code

Buy a scrip when RSI(14) goes above 50 from below 50, and ADX or DMI (14) above 20 and CCC(14) is above 0


As per above condition

Buy Script:

RSI(CLOSE, 14) > 50 AND
DIP(14) > 20 AND
CCI(12, SIMPLE) > 0

CCC you mean Commodity Channel Index (CCI) ?

ya cci, ccc typo

but i want to filter those stocks whose RSI 14 came above 50 today i.e. last bar only. i think as per above suggestion even though RSI is above 50 from many days then also those stocks will b screened.
please help.