Heiken Ashii & DMI

Hi,

I am new to Zerodha Pi, I need your help in the following buy , sell strategy.

Would you please write the script for below conditions.

Buy

  1. Candles - Heiken Ashi
  2. Candle stick value - 1 Day candles
  3. Moving Avg- 30 , 50
  4. DMI - 14

My Buy Condition : If yesterday closing price ( Not HA Prices, original market prices ) is closed above 30 Day & 50 Day moving average and + DMI Should be above - DMI

Sell Condition : When Ever + DMI Crooses - DMI from Above

Thanks ,

Cloned Investor