macd stratergy crossover and atr stoploss and target

I want to make one strategy using macd
Buy signal:
1)15 min chart macd line crosses above signal line crosover (should be above zero line)
2)1hr chart-macd line should be above signal line
3)enter when current candle break the prevous candle high
4)use atr to and resistance and support as stoploss and select the closest support (if ATR=45points )(closest support which is near to atr value 45 is support 1 )
5)trailing atr stoploss (atr value *3)
6)step 6 is optional but if you could do it it will be great for me what i want to do is when macd crosses above the signal line some times it makes small inverted triangles and the continue its direction if you could enter at that perticular point for last point i am sharing the image url(
thank you and same opposite steps for selling