Please help me building Pi script

Can someone please provide me a valid zerodha Pi script for below strategy :-

Buy = EMA( Close , 5 ) > EMA( Close , 20 )
AND RSI( 14 ) < 50
AND StochD( 14, 3, 3 ) > 50
AND MACD( 12, 26 ) > Signal( 12, 26, 9 );
Sell = EMA( Close , 5 ) < EMA( Close , 20 )
AND RSI( 14 ) > 50
AND StochD( 14, 3, 3 ) < 50
AND MACD( 12, 26 ) < Signal( 12, 26, 9 );

As per the above condition

Buy Script:

EMA(CLOSE,5)>EMA(CLOSE,20) AND RSI(CLOSE,14)<50 AND SOPD(9, 3, 9, SIMPLE) > 50 AND MACD(12, 26, 9, SIMPLE) > MACDSignal(12, 26, 9, SIMPLE)

Sell Script:

EMA(CLOSE,5)<EMA(CLOSE,20) AND RSI(CLOSE,14)>50 AND SOPD(9, 3, 9, SIMPLE) < 50 AND MACD(12, 26, 9, SIMPLE) < MACDSignal(12, 26, 9, SIMPLE)

Could you please provide code for my below strategy as well :slight_smile:

  1. Draw Fibonacci line between previous Day’s High and Low
  2. Time Frame Hourly
  3. If price close below the Fib level 127.2 (Go for Sell)
  4. Target: at Fib level 38.2
  5. Stop Loss above Fib level 161.8
  6. If price close above Fib level -27.2 (Go for Buy)
  7. Target: Fib level 38.2
  8. Stop Loss: below Fib level -61.8