Channel Breakout LE#

This is a trend-following strategy designed to capture breakouts and sustained market moves. It enters long when the market price breaks above the highest point over a lookback period, anticipating continued upward momentum. By placing the buy order slightly above the breakout level, the strategy aims to confirm trend continuation before entering, reducing the risk of false breakouts.

Source Code#

1
2
3
4
[IntrabarOrderGeneration = false]
Inputs: Price(High), Length(20);

Buy ("ChBrkLE") next bar at HighestFC(Price, Length) + 1 point stop;

Code Walkthrough#

1
[IntrabarOrderGeneration = false]

Ensures that only one order is generated per bar; orders are placed only when the bar is complete.

1
Inputs: Price(High), Length(20);

Defines two input parameters:

  • Price: Set to High, meaning the strategy calculates based on each bar’s high price.
  • Length: Set to 20, the number of past bars used to calculate the highest high.
1
Buy ("ChBrkLE") next bar at HighestFC(Price, Length) + 1 point stop;

Places a buy order named ChBrkLE. HighestFC(Price, Length) calculates the highest value of Price (High) over the past Length (20) bars. The buy price is set one point above that high and submitted as a stop order — the entry triggers when the market rises to that price.