My stratedy is based on conditions:
From the last 4 candles, if:
3 out of 4 candles are with the trend, take the trade. BUT: if the last candle is against the trend, don't take the trade.
It sounds confusing but I attached the picture, so is stupid simple, however I have NO IDEA how to do this on pine, I am new at this and a little help would be appreciated. Thanks.