Extremum Range MA Crossover Strategy by Script_Algo
By Script_Algo
Performance Metrics
- Author: Script_Algo
- Symbol: BINANCE:ADAUSDT.P
- Timeframe: 4 hours
- Net P&L: +757.77 USD (+7.58%)
- Win Rate: 45.8%
- Profit Factor: 2.368
- Max Drawdown: 116.36 USD (1.07%)
- Total Trades: 120
Description
1. Principle of Work & Strategy Logic โ๏ธ๐Main idea: The strategy tries to catch the moment of a breakout from a price consolidation range (flat) and the start of a new trend. It combines two key elements:Moving Average (MA) ๐: Acts as a dynamic support/resistance level and trend filter.Range Extremes (Range High/Low) ๐บ๐ป: Define the borders of the recent price channel or consolidation.The strategy does not attempt to catch absolute tops and bottoms. Instead, it enters an already formed move after the breakout, expecting continuation.Type: Trend-following, momentum-based.Timeframes: Works on different TFs (H1, H4, D), but best suited for H4 and higher, where breakouts are more meaningful.2. Justification of Indicators & Settings โ๏ธA. Moving Average (MA) ๐Why used: Core of the strategy. It smooths price fluctuations and helps define the trend. The price (via extremes) must cross the MA โ signals a potential trend shift or strengthening.Parameters:maLength = 20: Default length (โ one trading month, 20-21 days). Good balance between sensitivity & smoothing.Lower TF โ reduce (10โ14).Higher TF โ increase (50).maSource: Defines price source (default = Close). Alternatives (HL2, HLC3) โ smoother, less noisy MA.maType: Default = EMA (Exponential MA).Why EMA? Faster reaction to recent price changes vs SMA โ useful for breakout strategies.Other options:SMA ๐ฆ โ classic, slowest.WMA ๐จ โ weights recent data stronger.HMA ๐ฉ โ near-zero lag, but โnervous,โ more false signals.DEMA/TEMA ๐ง โ even faster & more sensitive than EMA.VWMA ๐ โ volume-weighted.ZLEMA โฑ โ reduced lag.๐ Choice = tradeoff between speed of reaction & false signals.B. Range Extremes (Previous High/Low) ๐Why used: Define borders of recent trading range.prevHigh = local resistance.prevLow = local support.Break of these levels on close = trigger.Parameters:lookbackPeriod = 5: Searches for highest high / lowest low of last 5 candles. Very recent range.Higher value (10โ20) โ wider, stronger ranges but rarer signals.3. Entry & Exit Rules ๐ฏLong signals (BUY) ๐ข๐Condition (longCondition): Previous Low crosses MA from below upwards.โ Price bounced from the bottom & strong enough to push range border above MA.Execution: Auto-close short (if any) โ open long.Short signals (SELL) ๐ด๐Condition (shortCondition): Previous High crosses MA from above downwards.โ Price rejected from the top, upper border failed above MA.Execution: Auto-close long (if any) โ open short.Exit conditions ๐ชExit Long (exitLongCondition): Close below prevLow.โ Uptrend likely ended, range shifts down.Exit Short (exitShortCondition): Close above prevHigh.โ Downtrend likely ended, range shifts up.โ ๏ธ Important: Exit = only on candle close beyond extremes (not just wick).4. Trading Settings โ๏ธoverlay = true โ indicators shown on chart.initial_capital = 10000 ๐ต.default_qty_type = strategy.cash, default_qty_value = 100 โ trades fixed $100 per order (not lots). Can switch to % of equity.commission_type = strategy.commission.percent, commission_value = 0.1 โ default broker fee = 0.1%. Adjust for your broker!slippage = 3 โ slippage = 3 ticks. Adjust to asset liquidity.currency = USD.margin_long = 100, margin_short = 100 โ no leverage (100% margin).5. Visualization on Chart ๐The strategy draws 3 lines:๐ต MA line (thickness 2).๐ด Previous High (last N candles).๐ข Previous Low (last N candles).Also: entry/exit arrows & equity curve shown in backtest.Disclaimer โ ๏ธ๐Risk Warning: This description & code are for educational purposes only. Not financial advice. Trading (Forex, Stocks, Crypto) carries high risk and may lead to full capital loss. You trade at your own risk.Testing: Always backtest & demo test first. Past results โ future profits.Responsibility: Author of this strategy & description is not responsible for your trading decisions or losses.