Need to write PI code for the Price-Volume action. Strategy is given below

buy
1.When increase in volume by 2% compared to 10 days average volume and price makes new day high when the primary trend of the stock is uptrend and
2.Current price should have broken the intraday resistance and stayed above the intraday resistance
sell
1.When increase in volume by 2% compared to 10 days average volume and price makes new low when the primary trend of the stock is downtrend and
2.Current price should have broken the intraday support and stayed below the intraday support

Do this on EOD chart-


Buy-
VOLUME> 1.02* SMA(VOLUME,10) AND TREND(CLOSE,10) =UP AND LAST>HIGH

Sell- 
VOLUME>1.02* SMA(VOLUME,10) AND TREND(CLOSE,10) =DOWN AND LAST<LOW

Hi Andrew,
What does TREND function denote in the script above? IS it some kind of indicator as well? Sorry, I am pretty new to TRADESCRIPT.
Thanks,
Snehil

TREND will check, if closing prices of candle/ periods are trending UP or down

Trend functions denotes to the primary trend of the stock. i.e Up trend or down trend.

Hi Andrew,
Only after seeing your code, I understood I didn’t give the strategy properly. But thanks for the code. I will work from here on. Thank you so much and much appreciated.

yup! welcome