Please help me code the below strategy (for pi)
Chart type : Renko chart with box size 10
Indicator : ADX/ Directional Moving Index setup : 5 (ADX, DMI derived based on Renko)
Entry Setup:
Long -
1) When DMI+ crosses, DMI- from below, With ADX > 20 : Enter at the start of the next Renko bar
or
2) When DMI+ is above DMI-, but is in a declining curve/value and the DMI+ slope turns positive again : Enter at the start of the next Renko bar(the bar succeeding the bar where the DMI+ slope turned +ve)

Short -
1) When DMI- crosses, DMI+ from below, With ADX > 20 : Enter at the start of the next Renko bar
or
2) When DMI- is above DMI+, but is in a declining curve/value and the DMI- slope turns positive again : Enter at the start of the next Renko bar
Exit setup:
Long -
1) Entry price - 2* Size of Renko bar (2 Renko bars below entry bar)
Short -
1) Entry price + 2* Size of Renko bar (2 Renko bars above entry bar)