The PopGun generator identifies and visualizes "PopGun" candlestick patterns on the chart. A PopGun pattern occurs when a candle is fully enclosed (encapsulated) between its two neighboring candles, followed by a breakout candle that confirms the direction.
Use a Controller object to add the generator to a chart:
const popGunGenerator = controller.addGenerator('PopGuns');
A PopGun pattern is identified when:
Additional filters:
Type: LineWidth
Default: 2
Details
The line width of the trigger lines in pixels.
Type: boolean
Default: false
Details
When enabled, the top trigger line extends to the right edge of the chart.
Type: boolean
Default: false
Details
When enabled, the bottom trigger line extends to the right edge of the chart.
Type: enum
Default: 0 (No limit)
Values: 0 (No limit) | 1 (5 days) | 2 (1 month) | 3 (12 months) | 4 (36 months) | 5 (60 months)
Details
Limits how far back in time PopGun patterns are detected. When set to "No limit", all available data is scanned.
Each confirmed PopGun pattern is drawn as:
'up-color''down-color'The trigger lines and candle highlights can be individually toggled per pattern via context menu actions:
The generator includes a legend entry. When a time limit is set, the legend displays the selected period.
The generator has a built-in permission check, which is called in its onStart method. It calls the provided checkPermission method (via Controller) with the key PopGuns.