Trade script code

how to write a trade script code for pivot point support,resistance combined with rsi

buy when last price hits the support either s1,s2,s3 and rsi<30

sell when last price hits resistance r1,r2,r3 and rsi>70

Pivot points are available in Pi by default on charts , just right click on charts and select pivot points,

Pivot points are not possible to code in tradescript