Squeeze Momentum Gold Buy-Only Stats — Strategy by edwinardyanto

By edwinardyanto

Performance Metrics

Description

Squeeze Momentum Gold Buy-Only Stats turns the popular Squeeze Momentum Indicator by LazyBear into a testable strategy and prints a statistics panel that compares two ways of trading it on the same chart.CreditsThe indicator math (Bollinger Bands inside Keltner Channels = squeeze, linear-regression momentum histogram, coloured squeeze crosses) is LazyBear's open-source "Squeeze Momentum Indicator [LazyBear]", ported to Pine v6 without changing the formula: All credit for the indicator goes to LazyBear. This script adds the trading rules, stop loss, BUY / EXIT markers and the statistics panel.What is added- Squeeze release = the first gray cross after a black cross (as described by the original author).Row 1 (default, author rule): on release, enter in the direction of momentum (histogram above zero = buy, below zero = sell); exit when the histogram colour changes (momentum turns). Buy and sell.Row 2 (best): same entry, buy only; exit when the histogram drops below zero, or at a stop loss of 2 x ATR(14) from the entry price.BUY / EXIT labels on the price chart and the strategy orders follow row 2.Option "Original formula": in the original code the Bollinger Band width uses the KC MultFactor (1.5) instead of the BB MultFactor input. It is kept on by default so the indicator looks exactly like the original; switch it off to use the BB MultFactor input.How results are measured (written openly so anyone can check them)- Signals are read on candle close; fills happen at the next candle open. No lookahead, no repainting. A stop that is gapped through fills at the open.Each trade uses a fixed 1x position (no leverage, no compounding). Trade result = % change minus spread on both sides (input, default 0.02% per side) minus swap/financing per day held (input, default 5% per year).Panel: closed trades, win rate, sum of trade %, profit factor (gross profit / gross loss), max drawdown of the summed trade curve, and results split into Sample In / Sample Out by the split date input.Only trades inside the Start / End date inputs are counted; a position still open at the end date is not counted.The built-in Strategy Tester uses 10% of equity per trade and no swap, so its numbers differ from the panel. The panel is the reference.Why buy only, exit below zero, 2 ATR stopThe indicator inputs were kept at their defaults. Only the way of trading it was varied (direction, trend filter, exit type, stop/target), chosen on the Sample In period (first half of the data) and then checked on Sample Out. Neighbouring lengths (14 and 30) with the same rule were also positive in both halves. Note: because of the original formula, changing KC MultFactor alone does not change the squeeze state.NotesHistorical statistics only. Past results do not guarantee future results. Spread and swap differ between brokers; adjust the inputs to your own conditions.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView