Canuck Trading KAMA Strategy by ctoincanada
By ctoincanada
Performance Metrics
- Author: ctoincanada
- Symbol: NASDAQ:TSLA
- Timeframe: 1 week
- Net P&L: +93,584.35 USD (+93.58%)
- Win Rate: 33.9%
- Profit Factor: 3.941
- Max Drawdown: 10,555.16 USD (7.52%)
- Total Trades: 56
Description
Canuck Trading KAMA StrategyOVERVIEWCanuck Trading KAMA is a strategy around one core idea: trade the color, manage the exit. Kaufman's Adaptive Moving Average (KAMA) determines trend direction. A dual health system handles all exit decisions.Two user inputs control the strategy: Trade Direction and Max Entry Distance.Everything else auto-calibrates from price action.CORE CONCEPTSKAMA (Kaufman Adaptive Moving Average)KAMA adjusts its speed using the Efficiency Ratio (ER). ER measures howmuch of the price path is directional versus noise. Trending marketsproduce a fast KAMA that tracks price closely. Choppy markets produce aslow KAMA that barely moves. This is the foundation of all signals.Fair Value Band (FVB)The colored line on the chart. Green means KAMA is rising (bullish),red means KAMA is falling (bearish), gray means choppy (neutral).Entries follow the color. Exits are managed by the health system.Deviation BandsUpper and lower bands are calculated from the standard deviation ofprice around KAMA over 20 bars, scaled by 2.0 standard deviations.Bands tighten in trends and widen in chop. This replaces the oldfixed ATR bands and adapts automatically to any instrument.ENTRY SIGNALSColor Trend EntryWhen KAMA turns green, a long entry fires if price is within the maxentry distance from KAMA (the proximity gate). When KAMA turns red,a short entry fires under the same proximity rule. A color settle gateblocks entries on the first bar of a direct red-to-green or green-to-redflip. Two consecutive bars of the new color are required to confirm thetrend is real and not a one-bar chop spike.In squeeze conditions (bands tight relative to their own average),the proximity gate is bypassed entirely since price is naturally closeto KAMA during squeezes.Gray Zone EntryWhen KAMA is gray (neutral), entries can still fire if structuralconfirmation is present. Gray longs require 2 or more gray bars,a higher low (buyers defending), and price above KAMA. Gray shortsrequire 2 or more gray bars, a lower high (sellers capping), andprice below KAMA. No proximity gate is applied to gray entries.The health system and follow-through exit manage risk.EXIT CHAINExits are evaluated every bar in priority order. The first matchingcondition triggers the exit.1. Follow-Through On the bar after entry, if price closes below the entry close (for longs) or above the entry close (for shorts), the position is closed immediately. This catches entries that fail to confirm on the next bar.2. Health Exit The dual health system scores the position from 0 to 6. If either sub-score drops to 0, or the combined score falls to 1 or below, the position is closed. A minimum holding period of 2 bars (3 in high volatility) prevents premature exits on entry noise.3. Gray Fade During gray periods, if 2 or more consecutive bars show structural deterioration (lower highs while long, higher lows while short), the position is closed. The pullback is deepening, not stabilizing.4. Gray Timeout If a position remains in gray for longer than twice the average color run length (minimum 6 bars), the position is closed. The trend that justified the entry is likely over.5. Direction Exit A full color reversal closes the position. Green to red exits longs. Red to green exits shorts. Gray pauses do not trigger this exit.DUAL HEALTH SYSTEMTwo independent scores evaluate position quality from different angles.KAMA Health (0-3)C - Color: bar color supports the position directionK - Slope: KAMA is still moving in the position's favorD - Duration: the color run has not exceeded the average run lengthPrice Health (0-3)S - Structure: higher lows for longs, lower highs for shortsM - Momentum: efficiency ratio is rising (directional energy building)V - Value: price on the favorable side of KAMAThe dashboard shows both scores with their individual factors. For example,K2 CK. P1 ..V means KAMA health is 2 (Color and Slope passing, Durationfailing) and Price health is 1 (only Value passing).VOLATILITY ADAPTATIONThe strategy adapts to volatility regimes automatically.Squeeze DetectionWhen bands are tight relative to their 20-bar average (ratio below 0.7),the dashboard shows SQUEEZE. The proximity gate is bypassed for colorentries since sigma-normalization inflates distances unreliably intight-band conditions.High VolatilityWhen bands are wide relative to their average (ratio above 1.3), thedashboard shows HIGH-VOL. The minimum holding period extends from 2 to3 bars to give trades more room in volatile conditions.Chop DetectionWhen the smoothing constant falls below the geometric mean of its range,KAMA enters gray (choppy). A rolling chop ratio tracks how many of thelast 10 bars were gray. Above 50 percent triggers the CHOP indicatoron the dashboard.USER INPUTSTrade DirectionLong, Short, or Both. Default: Long.Controls which side of the market the strategy trades.Max Entry Distance (sigma)Default: 1.0. Range: 0.1 and up, step 0.1.Maximum sigma-distance from KAMA for color trend entries. Lower valuesrequire price to be closer to KAMA before entering. Higher values allowentries further from fair value. Gray entries bypass this setting.The effective distance is scaled inversely by band width ratio, so itautomatically tightens in volatile conditions and loosens in squeezes.DASHBOARDThe dashboard displays 10 rows of live information.Row 0 Canuck Trading KAMA v5.0 headerRow 1 Price - current closeRow 2 KAMA - fair value level, colored by trendRow 3 Trend - BULLISH, BEARISH, or NEUTRALRow 4 Signal - current entry or exit signal with health scoreRow 5 Position - LONG, SHORT, or FLATRow 6 P&L - open profit/loss with percentageRow 7 ER - efficiency ratio with trend strength labelRow 8 Band - position within bands and volatility regimeRow 9 Health - dual health scores with factor breakdownSTRATEGY SETTINGSInitial Capital: 100,000Position Size: 10 percent of equityPyramiding: disabled (one position at a time)Commission: 0.1 percent per tradeSlippage: 1 tickOrder Execution: process orders on closeCalculation: on bar close onlyINTERNAL PARAMETERSThese values are fixed and proven through extensive testing. They are notexposed as inputs to prevent over-optimization.ER Length: 10 (Kaufman standard)Fast Period: 2 (fastest smoothing in strong trends)Slow Period: 30 (slowest smoothing in pure chop)Deviation Length: 20 (band width lookback)Band Multiplier: 2.0 (standard deviations for band width)CHANGES FROM v3.2- ATR bands replaced with self-tuning KAMA deviation bands- Quality scoring system removed entirely- Candle pattern detection removed entirely- Gray zone intelligence replaced with structural confirmation entries- Smart hold/verdict system replaced with dual health scoring- Band profit-taking removed- KAMA smoothing option removed (raw Kaufman behavior only)- Sharp flip protection retained and enhanced with color settle gate- Follow-through exit added (entry close confirmation)- Gray fade exit added (structural deterioration detection)- Gray timeout exit added (adaptive based on average run length)- Dashboard reduced from 13 rows to 10- Max Entry Distance added as configurable input- Codebase reduced from 900+ lines to approximately 540 linesDISCLAIMERThis strategy is provided for educational and informational purposes only.It is not financial advice, and it does not constitute a recommendation tobuy, sell, or hold any security or financial instrument.Past performance in backtesting does not guarantee future results. Alltrading involves risk, including the potential loss of principal. You aresolely responsible for your own trading decisions.The author makes no warranties regarding the accuracy, completeness, orreliability of this strategy. Use it at your own risk. Always do your ownresearch and consult a qualified financial advisor before making investmentdecisions.This strategy uses simulated order execution with process_orders_on_closeenabled, which means backtest results assume fills at the closing price ofthe signal bar. Live trading conditions including slippage, liquidity, andexecution delays may produce different results.