A good strategy for executing pending orders?

The market always avoids my pending orders. I researched why that is the case and I found out because the actual price needs to touch the price of the pending order. The actual price is different than the market price.The yellow line on my mt4 is the actual price.
This is an example of a pending order that was dodged. A miss opportunity.
Here is the strategy to overcome this hurdle.
(The top of a S/R zone price) - (The spread points)
Look at the screenshot of a LIVE market. The green dashed line is the failed opportunity. The red line is the corrected entry line that could’ve been a well executed trade position.

Use this strategy for entries, stop losses, and take profit. Adjust this formula to accommodate entries, stop losses, and take profit using the spread and the price of entry.

Still not clear how to incorporate results from particular trade into the trading algorithm. I mean every trade is different and I guess you need to formalise your idea, i.e. wrap it up with some precise rules.

Notice that most brokers’ charts show only the bid price (selling price) of the market in question. In some cases you can manually re-set this to display the ask price (buying price).