Can Somebody help me code an EA with the following rules:

1) price within 20 pips of the daily high/low - Which is OPPORTUNITY
Two) up/down candle closes
3) up/down candle closes - Notice the Large price of This up/down candle
4) enter long at the up/down candle's high/low price
5) SL and TP options are also Required

E.g. Shooting a Brief position

1)Price makes a new daily high
2)The Upward candle closes
3)The Downward candle Shuts
4)Input short at the low of This Downward candle

E.g. Taking a long position

1)Price makes a new daily low
2)The Downward candle Shuts
3)The Upward candle Shuts
4)Input long at the Top of This up candle