I will give you some trading examples to help you understand how to trade the pin bar candlestick pattern with the trend. and how to use the confluence concept to confirm your entries.
See the chart below:

This is the NZDUSD daily chart, as you can see the market is trending down. this is the first information that we gather from this chart.
After the breakout of the support level that becomes resistance, the price retraced back to this level, and formed a pin bar candlestick pattern.
The formation of the pin bar near the resistance level indicates that the retracement move is over, and the beginning of an impulsive move is likely to happen.
When we put the 21 moving average and the Fibonacci retracement on the chart, we see that the pin bar is rejected from these levels which indicates that this level is very important and sellers are willing to push
the market lower.
Here in this example we have solid reasons to sell the market, the first reason is the downtrend.
The second reason is the formation of the pin bar near the resistance level which indicates the end of the pullback and the beginning of a new move downward.
The third reason is the rejection of the pin bar from the resistance level, and from the 21-moving average,
The last reason is the pin bar rejection from the 50% Fibonacci retracement level which is considered to be one of the most powerful key levels in the market.
Look at the chart below to see what happened next:

As you can see in the chart above, our analysis was right, because it was based on solid reasons to enter the market.
This is the method that i want you to learn to be able to trade the market successfully. Look at another chart below:

The chart above shows two important buying opportunities.
The market was trending up, the formation of the first pin bar after the retracement back to the support level was a high probability entry.
What confirms our entry is the rejection from the 21-moving average, and the 50% Fibonacci retracement.
The same thing happens with the second pin bar that allowed us to enter the market again and make more profits.