Stoploss below/above 1M candlestick?

 

Recently, I have been testing my new strategy on forex market and I figured, that it would be much more efficient with some automation.
As I'm completely inexperienced if it comes to MQL programming, I just wanted to ask you, as an experts, if it's possible to create such EA (I trade on MT5): 


The general idea is that I decide whether to open long or short position.

An automation that happens when I open long position:

1. Stoploss is set "x" pips below 1M candlestick's open price.
a) stoploss is activated when a bid price reaches the level mentioned above.
b) "x" can be modified

2. The transaction is closed automatically, when the same 1M candlestick closes.
If the above is not possible to set, the transaction closes at the end of the minute of the current 1M candlestick (considering my system time). So, let's say I've opened a long position at 11:34:09. In such case, the transaction should be closed at 11:35:00.


An automation that happens when I open short position:

1. Stoploss is set "x" pips above 1M candlestick's open price.
a) stoploss is activated when a ask price reaches the level mentioned above.
b) "x" can be modified

2. The transaction is closed automatically, when the same 1M candlestick closes.
If the above is not possible to set, the transaction closes at the end of the minute of the current 1M candlestick (considering my system time). So, let's say I've opened a long position at 11:34:09. In such case, the transaction should be closed at 11:35:00.

If you think it's possible to create such EA, do you know any places, people who may write the code for me (not for free of course)?

Thanks!

Reason: