Amibroker Afl Collection -
You can save it as MTF_Trend_Momentum.afl .
// ----------------------------------------------------------- // USER INPUTS // ----------------------------------------------------------- TF1 = ParamTimeFrame("Higher Timeframe", "Weekly"); TF2 = ParamTimeFrame("Lower Timeframe", "Daily");
// ----------------------------------------------------------- // HIGHER TIMEFRAME TREND (e.g., Weekly) // ----------------------------------------------------------- TimeFrameSet(TF1); HTF_Close = C; HTF_MA = MA(C, PeriodMA); HTF_RSI = RSI(RSIPeriod); HTF_TrendUp = HTF_Close > HTF_MA; HTF_TrendDown = HTF_Close < HTF_MA; TimeFrameRestore(); amibroker afl collection
// Higher Timeframe MA Plot(HTF_MA_Exp, "HTF MA (" + Name() + ")", colorOrange, styleLine | styleThick);
Short = SellSignal; // Example short logic Cover = BuySignal; You can save it as MTF_Trend_Momentum
ShowSignals = ParamToggle("Show Buy/Sell Signals", "No|Yes", 1); ShowZones = ParamToggle("Show Trend Zones", "No|Yes", 1);
// Optional: Exit signals Buy = ExRem(BuySignal, SellSignal); Sell = ExRem(SellSignal, BuySignal); TF2 = ParamTimeFrame("Lower Timeframe"
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone), colorBrightGreen, 0, Low, -15); PlotShapes(IIf(Sell, shapeDownArrow, shapeNone), colorRed, 0, High, -15); PlotShapes(IIf(Short, shapeHollowDownArrow, shapeNone), colorOrange, 0, High, -25); PlotShapes(IIf(Cover, shapeHollowUpArrow, shapeNone), colorLime, 0, Low, -25);