This block trades a bounce off a trendline. It draws its lines exactly as the trendline break and retest blocks do: from swings on the timeframe you name, with the candles each side, the touches and the touch tolerance you set. It works in Backtest, the Bot and your strategy's chart, which marks every bounce on your chart and in the script you copy to TradingView or another platform.
When it fires
At the close of a candle whose wick comes back to a line that has not broken, within your touch tolerance:
- a low back at an up line (under price) is a long;
- a high back at a down line (over price) is a short.
Each line fires once. The candle that finished drawing a line can't fire on it.
A candle that closes beyond the line breaks it. That gives no signal, and the line is used up. A line drawn again through the same two swings does not fire again.
Where the stop goes
- The line: the line's price at the close of the candle that fired.
- The candle that fired: its low for a long, its high for a short.
- A swing window: the lowest low or highest high of a number of candles you state.
- A set distance: ticks from the entry, which you type.
You can add a buffer of ticks beyond any of them. If the stop would be on the wrong side of the entry, no trade is placed.
Every number is yours
The timeframe, the candles each side of a swing, the touches, the tolerance and the stop all start blank. The builder flags any you leave empty, and the strategy won't run until you fill them in.
What can go wrong
People draw trendlines in different ways. This block draws them only as described, so read the rule before comparing with a line drawn manually.