Creating a TP and SL based on support and resistance

 
I'm trying to code my strategy on MQL4. A problem I'm running into is how I can set my Take Profit and Stop Loss based on the previous support and resistance. Or setting a take profit based on Fib retracements. Below I attached a picture of how the support and resistance work. 
Basic Principles - Trading Operations - MetaTrader 5 Help
Basic Principles - Trading Operations - MetaTrader 5 Help
  • www.metatrader5.com
Before you proceed to study the trade functions of the platform, you must have a clear understanding of the basic terms: order, deal and position...
Files:
download.png  140 kb