Looking for a script to generate buy/sell alarms in PI

Hi,

I am looking for a script which can generate an alarm for the following buy/sell conditions.
Could someone pls provide me the executable script.

thanx & regards,
Nabs

In a hourly candle chart apply the following rules to derive the buy/sell condition

Buy rule:

  1. The candle should have closed above the 50 EMA
  2. MACD histogram should be above the zero level
  3. RSI should be above the 50 line
  4. Entry is above the broken Pivot points(22 day Pivot)

Sell rule:

  1. The candle should have closed below the 50 EMA
  2. MACD histogram should be below the zero level
  3. RSI should be below the 50 line
  4. Entry is below the broken Pivot points(22 day Pivot)

As per the above query

BuyScript:

CLOSE>EMA(CLOSE,50) AND MACD(13, 26, 9, SIMPLE)>0 AND RSI(CLOSE,14)>50

Sellscript:

CLOSE<EMA(CLOSE,50) AND MACD(13, 26, 9, SIMPLE)<0 AND RSI(CLOSE,14)<50

Pivot points can not be defined through tradescript, but, pi has pivot points by default, we can define manually by using price alert indicator​

Pivot points can not be defined through tradescript, but, pi has pivot points by default, we can define manually by using price alert indicator, can we code by using that for pivots?