// ----------------------------------------------------------- // SIGNAL GENERATION (Confluence) // ----------------------------------------------------------- // Buy: HTF trend up + LTF momentum up + RSI not overbought BuySignal = HTF_TrendUp_Exp AND LTF_MomentumUp AND LTF_RSI < RSIOverbought; // Sell: HTF trend down + LTF momentum down + RSI not oversold SellSignal = HTF_TrendDown_Exp AND LTF_MomentumDown AND LTF_RSI > RSIOversold;

// Lower Timeframe MA Plot(LTF_MA, "LTF MA", colorYellow, styleLine | styleDots);

// RSI in separate window rsiColor = IIf(LTF_RSI > RSIOverbought, colorRed, IIf(LTF_RSI < RSIOversold, colorGreen, colorLightGrey)); Plot(LTF_RSI, "RSI (" + RSIPeriod + ")", rsiColor, styleLine | styleThick); Plot(RSIOverbought, "OB", colorRed, styleDashed); Plot(RSIOversold, "OS", colorGreen, styleDashed); amibroker afl collection

You can save it as MTF_Trend_Momentum.afl .

// Signals if(ShowSignals)

// ----------------------------------------------------------- // COMMENT BLOCK (for documentation) /* == MULTI-TIMEFRAME TREND & MOMENTUM SCANNER ==

ShowSignals = ParamToggle("Show Buy/Sell Signals", "No|Yes", 1); ShowZones = ParamToggle("Show Trend Zones", "No|Yes", 1); // Lower Timeframe MA Plot(LTF_MA

// Optional: Exit signals Buy = ExRem(BuySignal, SellSignal); Sell = ExRem(SellSignal, BuySignal);