Need code for VWAP/ATP

Hi, I need tradescript code for the following conditions 1. Give alert when price touches the VWAP/ ATP of previous day. 2. 5min candle should close above/below the ATP of yesterday. Then, initiate the trade on the Low/High of that candle and stop loss is Low/High of the candle. After 5mins candle touches ATP, sell/buy as per below: SHORT- If the touching candle CLOSES below ATP (RED), then SELL below LOW of the touching candle with candle high as SL. LONG - If the touching candle CLOSES above ATP (GREEN), then BUY above HIGH of the touching candle with candle low as SL

On same conditions with different time frames can not be defined with tradescript, and VWAP is not possible with tradescript