Page 10 of 14

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:54 am
by PTScalper
How This Script Serves the Strategy

Zero Line Clutter: The traditional moving average lines (Tenkan/Kijun) and the lagging line (Chikou) are calculated purely in the background to generate the Cloud, but they are deliberately hidden from the chart. This preserves visual space for drawing liquidity grabs, order blocks, and structural breaks.

Instant Context Check: The forward-projected fill provides an immediate macro-trend overlay. If you are hunting for a short setup via a structural break on a 1-minute or 5-minute chart, a quick glance to see if the price is trading below a red cloud provides instant high-timeframe confluence.

Chop Zone Warning: An optional background highlight lightly shadows the chart if the current price enters inside the bounds of the Cloud, flagging a transitional or neutral state where standard SMC trend continuation setups might face unexpected turbulence.

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:55 am
by PTScalper
The integration of the Ichimoku Kumo (Cloud) into a Smart Money Concepts (SMC) or algorithmic order-flow framework requires strict visual and functional discipline. Professional scalping demands a chart free of lag-heavy derivative lines. When upgrading this concept to a professional standard, the Cloud ceases to be a traditional indicator and instead becomes a macro-regime filter.

By stripping away the Tenkan-sen, Kijun-sen, and Chikou Span, we isolate the Kumo to serve a singular purpose: defining the higher-timeframe directional bias and highlighting high-friction zones (chop), leaving the structural foreground completely clear for mapping liquidity voids, order blocks, and market structure shifts (MSS).

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:55 am
by PTScalper
To meet institutional and advanced retail standards, the Pine Script below has been upgraded to include native Multi-Timeframe (MTF) support, streamlined inputs with a clean UI, and strict visual hierarchy.

Code: Select all

//@version=5
indicator("Kumo Regime Filter [Pro SMC]", overlay=true, timeframe="", timeframe_gaps=true)

// =========================================================================
// INPUT PARAMETERS
// =========================================================================
grp_ichi = "Core Engine (Standard: 9, 26, 52, 26)"
tenkanLen = input.int(9, title="Conversion Line (Tenkan)", minval=1, group=grp_ichi)
kijunLen  = input.int(26, title="Base Line (Kijun)", minval=1, group=grp_ichi)
senkouLen = input.int(52, title="Leading Span B (Senkou B)", minval=1, group=grp_ichi)
offset    = input.int(26, title="Displacement Offset", minval=1, group=grp_ichi, tooltip="Forward projection of the Kumo.")

grp_ui = "Visual Hierarchy & Regime Rendering"
bullColor = input.color(color.new(#00E676, 85), title="Bullish Regime (Kumo)", group=grp_ui)
bearColor = input.color(color.new(#FF5252, 85), title="Bearish Regime (Kumo)", group=grp_ui)
chopColor = input.color(color.new(#787B86, 90), title="High-Friction Zone (Inside)", group=grp_ui)
showChop  = input.bool(true, title="Highlight High-Friction Zones", group=grp_ui)

// =========================================================================
// CALCULATIONS (Donchian Midpoints)
// =========================================================================
midpoint(len) => math.avg(ta.lowest(len), ta.highest(len))

// Background calculation of base lines (Intentionally not plotted)
tenkan = midpoint(tenkanLen)
kijun  = midpoint(kijunLen)

// Cloud bounds
spanA = math.avg(tenkan, kijun)
spanB = midpoint(senkouLen)

// =========================================================================
// RENDERING & PLOTTING
// =========================================================================
// Projecting the cloud boundaries forward
pA = plot(spanA, offset=offset - 1, color=color.new(bullColor, 40), title="Leading Span A", linewidth=1)
pB = plot(spanB, offset=offset - 1, color=color.new(bearColor, 40), title="Leading Span B", linewidth=1)

// Dynamic Fill based on Cloud polarity
kumoColor = spanA > spanB ? bullColor : bearColor
fill(pA, pB, color=kumoColor, title="Regime Fill")

// =========================================================================
// REGIME IDENTIFICATION (Chop Zone Logic)
// =========================================================================
// Checks if current close is trapped between the historically projected Span A and Span B
spanA_historical = spanA[offset - 1]
spanB_historical = spanB[offset - 1]

isTrapped = (close <= math.max(spanA_historical, spanB_historical)) and (close >= math.min(spanA_historical, spanB_historical))

bgcolor(showChop and isTrapped ? chopColor : na, title="High-Friction Background")

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:55 am
by PTScalper
Strategic Implementation for Professional Scalpers

Native Multi-Timeframe (MTF) Architecture

The script utilizes Pine Script v5's native timeframe="" parameter. This allows you to trade on a 1-minute execution chart while seamlessly pulling the Kumo regime data from the 15-minute or 1-hour chart via TradingView's indicator settings. This creates a true top-down directional filter without needing to switch tabs or split screens.

Execution Parameters

Bullish Regime (Green Kumo + Price Above): Only authorize structural long setups (e.g., bullish MSS, tapping into discount order blocks). Ignore bearish liquidity sweeps.

Bearish Regime (Red Kumo + Price Below): Only authorize structural short setups (e.g., bearish MSS, tapping into premium order blocks).

High-Friction Zone (Gray Background): When price enters the cloud bounds, the script automatically shades the background gray. For an SMC scalper, this signifies equilibrium, heavy chop, and institutional repositioning. The professional protocol here is capital preservation—suspend typical trend-continuation models until price cleanly displaces outside the Kumo.

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:57 am
by PTScalper
MQL5 natively supports the DRAW_FILLING plot style to seamlessly replicate the solid Kumo fill from the Pine Script. MQL4 lacks a main-chart fill style, so the MQL4 iteration strictly projects the boundary lines (Span A and Span B) to maintain the clutter-free professional standard without bogging down the terminal with hundreds of graphical rectangle objects.

MQL5 (MT5) — Native Kumo Fill

This version calculates the Donchian midpoints natively in a forward-processing loop to bypass the well-known ArraySetAsSeries traps associated with MQL5's ArrayMaximum logic.

Code: Select all

//+------------------------------------------------------------------+
//|                                           KumoRegimeFilter.mq5   |
//+------------------------------------------------------------------+
#property copyright "Pro SMC"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   1

// Render a dynamic fill between Buffer 0 and Buffer 1
#property indicator_type1   DRAW_FILLING
#property indicator_color1  clrMediumSeaGreen, clrLightCoral // Bullish (A>B), Bearish (B>A)

input int InpTenkanLen = 9;   // Conversion Line (Tenkan)
input int InpKijunLen  = 26;  // Base Line (Kijun)
input int InpSenkouLen = 52;  // Leading Span B (Senkou B)
input int InpOffset    = 26;  // Displacement Offset

double SpanABuffer[];
double SpanBBuffer[];

int OnInit()
  {
   SetIndexBuffer(0, SpanABuffer, INDICATOR_DATA);
   SetIndexBuffer(1, SpanBBuffer, INDICATOR_DATA);
   
   // Forward-project the fill
   PlotIndexSetInteger(0, PLOT_SHIFT, InpOffset);
   PlotIndexSetString(0, PLOT_LABEL, "Span A;Span B");
   
   return(INIT_SUCCEEDED);
  }

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   if (rates_total < InpSenkouLen) return 0;
   
   int limit;
   if (prev_calculated == 0)
      limit = InpSenkouLen - 1; 
   else
      limit = prev_calculated - 1;
      
   for(int i = limit; i < rates_total; i++)
     {
      // Calculate Tenkan
      int tenkan_start = i - InpTenkanLen + 1;
      int tenkan_high_idx = ArrayMaximum(high, tenkan_start, InpTenkanLen);
      int tenkan_low_idx  = ArrayMinimum(low, tenkan_start, InpTenkanLen);
      double tenkan = (high[tenkan_high_idx] + low[tenkan_low_idx]) / 2.0;
      
      // Calculate Kijun
      int kijun_start = i - InpKijunLen + 1;
      int kijun_high_idx = ArrayMaximum(high, kijun_start, InpKijunLen);
      int kijun_low_idx  = ArrayMinimum(low, kijun_start, InpKijunLen);
      double kijun = (high[kijun_high_idx] + low[kijun_low_idx]) / 2.0;
      
      // Senkou Span A (Projected internally via PLOT_SHIFT)
      SpanABuffer[i] = (tenkan + kijun) / 2.0;
      
      // Calculate Senkou Span B
      int senkou_start = i - InpSenkouLen + 1;
      int senkou_high_idx = ArrayMaximum(high, senkou_start, InpSenkouLen);
      int senkou_low_idx  = ArrayMinimum(low, senkou_start, InpSenkouLen);
      SpanBBuffer[i] = (high[senkou_high_idx] + low[senkou_low_idx]) / 2.0;
     }
     
   return(rates_total);
  }

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:58 am
by PTScalper
MQL4 (MT4) — Minimalist Boundary Edition

Since MT4 requires heavy custom objects (OBJ_TRENDBYANGLE or layered histograms) to fake a chart fill, this version strips it down to thick boundary lines. This retains the macro-bias visual read while keeping the foreground perfectly clear for structural SMC drawing.

Code: Select all

//+------------------------------------------------------------------+
//|                                           KumoRegimeFilter.mq4   |
//+------------------------------------------------------------------+
#property copyright "Pro SMC"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 clrMediumSeaGreen
#property indicator_color2 clrLightCoral
#property indicator_width1 2
#property indicator_width2 2

input int InpTenkanLen = 9;   // Conversion Line (Tenkan)
input int InpKijunLen  = 26;  // Base Line (Kijun)
input int InpSenkouLen = 52;  // Leading Span B (Senkou B)
input int InpOffset    = 26;  // Displacement Offset

double SpanABuffer[];
double SpanBBuffer[];

int OnInit()
  {
   // Span A
   SetIndexBuffer(0, SpanABuffer);
   SetIndexStyle(0, DRAW_LINE);
   SetIndexLabel(0, "Leading Span A");
   SetIndexShift(0, InpOffset);
   
   // Span B
   SetIndexBuffer(1, SpanBBuffer);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexLabel(1, "Leading Span B");
   SetIndexShift(1, InpOffset);
   
   return(INIT_SUCCEEDED);
  }

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   if (rates_total < InpSenkouLen) return 0;
   
   int limit = rates_total - prev_calculated;
   if(limit == 0) limit = 1;
   if(prev_calculated == 0) limit = rates_total - InpSenkouLen;
   
   // Standard MQL4 reverse processing (current bar is index 0)
   for(int i = limit - 1; i >= 0; i--)
     {
      double tenkan_high = high[iHighest(NULL, 0, MODE_HIGH, InpTenkanLen, i)];
      double tenkan_low  = low[iLowest(NULL, 0, MODE_LOW, InpTenkanLen, i)];
      double tenkan = (tenkan_high + tenkan_low) / 2.0;
      
      double kijun_high = high[iHighest(NULL, 0, MODE_HIGH, InpKijunLen, i)];
      double kijun_low  = low[iLowest(NULL, 0, MODE_LOW, InpKijunLen, i)];
      double kijun = (kijun_high + kijun_low) / 2.0;
      
      SpanABuffer[i] = (tenkan + kijun) / 2.0;
      
      double senkou_high = high[iHighest(NULL, 0, MODE_HIGH, InpSenkouLen, i)];
      double senkou_low  = low[iLowest(NULL, 0, MODE_LOW, InpSenkouLen, i)];
      SpanBBuffer[i] = (senkou_high + senkou_low) / 2.0;
     }
     
   return(rates_total);
  }

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:58 am
by PTScalper
Expert Advisor (EA) Integration Note

Unlike Pine Script, MT4/MT5 do not handle native multi-timeframe visualization without significant terminal overhead. For algorithmic execution, avoid trying to code the MTF shift directly into the indicator. Instead, use your EA to request the higher timeframe context dynamically via iCustom.

If your execution logic is operating on the PERIOD_M1 chart, simply call iCustom(..., PERIOD_M15, ...) pointing to this Kumo filter. If Span A > Span B on the M15 pull, authorize long structural setups on the M1.

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:59 am
by PTScalper
cTrader’s native C# architecture handles forward projection and fill logic far more efficiently than MQL. By leveraging cAlgo’s [Cloud] class attribute and directly indexing future arrays (index + Displacement), we can render the Kumo regime filter with zero lag and no heavy graphical objects.

To optimize memory and execution speed—critical for a scalping environment—this script bypasses cTrader's built-in Maximum/Minimum indicator objects in favor of a lightweight, manual Donchian calculation loop.

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 11:59 am
by PTScalper
Code for Ctrader

Code: Select all

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;

namespace cAlgo
{
    // The native Cloud attribute automatically handles the dynamic fill between the two output series
    [Cloud("SpanA", "SpanB")]
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class KumoRegimeFilter : Indicator
    {
        #region Input Parameters

        [Parameter("Tenkan (Conversion)", DefaultValue = 9, Group = "Core Engine", MinValue = 1)]
        public int TenkanPeriods { get; set; }

        [Parameter("Kijun (Base)", DefaultValue = 26, Group = "Core Engine", MinValue = 1)]
        public int KijunPeriods { get; set; }

        [Parameter("Senkou B (Leading B)", DefaultValue = 52, Group = "Core Engine", MinValue = 1)]
        public int SenkouBPeriods { get; set; }

        [Parameter("Displacement Offset", DefaultValue = 26, Group = "Core Engine", MinValue = 1)]
        public int Displacement { get; set; }

        #endregion

        #region Output Series

        [Output("Span A", LineColor = "MediumSeaGreen", PlotType = PlotType.Line, Thickness = 2)]
        public IndicatorDataSeries SpanA { get; set; }

        [Output("Span B", LineColor = "LightCoral", PlotType = PlotType.Line, Thickness = 2)]
        public IndicatorDataSeries SpanB { get; set; }

        #endregion

        public override void Calculate(int index)
        {
            // Wait for enough data to calculate the longest moving component
            if (index < SenkouBPeriods) return;

            // Core Engine calculations
            double tenkan = GetDonchianMidpoint(index, TenkanPeriods);
            double kijun = GetDonchianMidpoint(index, KijunPeriods);
            double senkouB = GetDonchianMidpoint(index, SenkouBPeriods);

            // Span A is the median of the two shorter-term base lines
            double senkouA = (tenkan + kijun) / 2.0;

            // Forward Projection: cTrader natively supports assigning values to future indices
            int targetIndex = index + Displacement;
            
            SpanA[targetIndex] = senkouA;
            SpanB[targetIndex] = senkouB;
        }

        /// <summary>
        /// Lightweight Donchian midpoint calculation to avoid instantiating nested indicator objects.
        /// </summary>
        private double GetDonchianMidpoint(int currentIndex, int periods)
        {
            double highest = double.MinValue;
            double lowest = double.MaxValue;

            int startIndex = Math.Max(0, currentIndex - periods + 1);

            for (int i = startIndex; i <= currentIndex; i++)
            {
                if (Bars.HighPrices[i] > highest) 
                    highest = Bars.HighPrices[i];
                    
                if (Bars.LowPrices[i] < lowest) 
                    lowest = Bars.LowPrices[i];
            }

            return (highest + lowest) / 2.0;
        }
    }
}

Re: Free SMC Trading Setups

Posted: Sat Sep 19, 2026 12:00 pm
by PTScalper
Architectural Advantages for cTrader Setup

Dynamic [Cloud] Attribute: cTrader automatically understands that SpanA and SpanB form a bounded region. When SpanA (MediumSeaGreen) crosses above SpanB (LightCoral), the cloud fill inherently adapts to the dominant trend color.

Direct Future Array Assignment: Because cAlgo's IndicatorDataSeries arrays dynamically resize and accept future index assignments (index + Displacement), you don't have to fight the API with negative shift logic or visual offsets like in MQL or Pine. The data physically lives on the projected bar.

cBot (EA) Readiness: If you migrate this into an automated scalping cBot, the execution logic is drastically simplified. To check the higher timeframe regime, simply instantiate this indicator on your chosen timeframe (e.g., M15) and query the historical index:
bool isBullish = kumoFilter.SpanA[index] > kumoFilter.SpanB[index];