Please help me to code RSI and CCI

Dear Experts,

Kindly provide a code for below strategy.

Buy:

1. CCI 14 period - above 0

2.  RSI 14 period - above 50

Sell:

1. CCI 14 period - below 0 

2.  RSI 14 period - below 50