Tradescript code for PI scanner EMA crossover, MACD Crossover and stoic

Hi anybody help me for coding below strategy:

  1. 5EMA crossing over 20EMA and
  2. MACD line crossing over MACD Signal line and
  3. Stochastic oscillator in oversold region (below 30) turning positive and
  4. Price increase along with increase in volume in comparison with previous candle when 5EMA crosses over 20EMA.

Regards,
Mitesh Thakkar

For the above condition

CROSSOVER(EMA(CLOSE,5),EMA(CLOSE,20)) AND MACDSignal(13, 26, 9, SIMPLE) < MACD(13, 26, 9, SIMPLE) AND SOPK(14, 7, 3, SIMPLE) < SOPD(14, 7, 3, SIMPLE) AND VOLUME > REF(VOLUME,1)

2 Likes

Dear @AlgoGeek Thanks for the codes…
Can you assist with set of codes for a sell call with same above strategy…

Also, if you can advice any exit strategy for both buy and sell.

Dear @AlgoGeek Plz help me for coding required for scripted alert in Pi :

  1. Buy when candel close above 13EMA
  2. Exit with Target .6% and SL .3%

Regards,
Akash