SSL_sBar_KaleOrg_sw_mtf
Download scriptThis tool is designed to assist traders in identifying market trends and potential reversal points by analyzing price action relative to moving averages across different timeframes. It functions as a visual signaling system that highlights whether the current momentum is bullish (upward) or bearish (downward).
Core Logic and Functionality
Trend Detection Mechanism The script operates by comparing the closing price of a candle against two specific types of moving averages: one based on the "High" prices and another based on the "Low" prices.
- Bullish Signal: When the price closes above the average of previous high points, the system identifies an upward trend.
- Bearish Signal: When the price closes below the average of previous low points, the system identifies a downward trend.
Visual Signaling Instead of complex lines, the script uses clear visual markers (arrows) to notify the user of these shifts:
- Green Arrows: These appear when the logic confirms an upward movement, indicating that the price is maintaining strength above its historical highs.
- Red Arrows: These appear when the logic confirms a downward movement, indicating that the price is weakening below its historical lows.
Key Features
Multi-Timeframe Analysis (MTF) One of the primary strengths of this script is its ability to "look ahead" into different time horizons. You can set the tool to display data from larger timeframes (such as Hourly, Daily, or Weekly charts) while you are looking at a smaller chart (like a 1-minute or 5-minute chart). This helps traders see the "big picture" and ensure they aren't trading against the dominant long-term trend.
Customizable Sensitivity The tool includes several adjustable parameters to tailor the experience to different trading styles:
- Bar Level: Allows you to define the specific threshold for the signals.
- Bars Size: Adjusts the physical size of the visual arrows on your screen for better visibility.
- Timeframe Selection: Provides a pre-configured list of common intervals, allowing you to switch between various time periods seamlessly without changing your actual chart view.
Summary for the User Essentially, this script acts as a filter. It ignores minor market "noise" and focuses on significant shifts in momentum. By identifying when the price breaks through established average boundaries, it provides a visual cue of where the market trend is heading, helping you stay aligned with the overall direction of the price movement.
//+------------------------------------------------------------------+
//| SSL.mq4 |
//|ssl bar sw mtf Kalenzo |
//| bartlomiej.gorski@gmail.com |
//+------------------------------------------------------------------+
//2008fxtsd ki
#property copyright "Kalenzo"
#property link "bartlomiej.gorski@gmail.com"
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_minimum 10
#property indicator_maximum 90
extern int Lb = 10;
extern int SSL_BarLevel = 15; //BarLevel 10-90
extern int BarsSize = 2; //0-5
extern int TimeFrame=0;
extern string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF";
string IndicatorFileName;
double ssl[],Hld,Hlv, sslHup[],sslHdn[],PriceBuff[];
#property indicator_separate_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(3);
SetIndexBuffer (0,sslHup);
SetIndexArrow (0,167);
SetIndexLabel (0,"SSLup "+Lb+"["+TimeFrame+"]");
SetIndexBuffer (1,sslHdn);
SetIndexArrow (1,167);
SetIndexLabel (1,"SSLdn "+Lb+"["+TimeFrame+"]");
SetIndexBuffer (2,ssl);
SetIndexLabel (2,"");
SetIndexStyle(0,DRAW_ARROW,0,BarsSize);
SetIndexStyle(1,DRAW_ARROW,0,BarsSize);
SetIndexStyle(2,DRAW_NONE);
SetIndexEmptyValue(0,EMPTY_VALUE);
SetIndexEmptyValue(1,EMPTY_VALUE);
switch(TimeFrame)
{
case 1 : string TimeFrameStr= "M1"; break;
case 5 : TimeFrameStr= "M5"; break;
case 15 : TimeFrameStr= "M15"; break;
case 30 : TimeFrameStr= "M30"; break;
case 60 : TimeFrameStr= "H1"; break;
case 240 : TimeFrameStr= "H4"; break;
case 1440 : TimeFrameStr= "D1"; break;
case 10080 : TimeFrameStr= "W1"; break;
case 43200 : TimeFrameStr= "MN1"; break;
default : TimeFrameStr= "TF0";
}
IndicatorShortName("SSL "+Lb+"["+TimeFrameStr+"]");
IndicatorFileName = WindowExpertName();
if (TimeFrame<Period()) TimeFrame=Period();
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i,limit;
if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
if (TimeFrame != Period())
{
datetime TimeArray[];
limit = MathMax(limit,TimeFrame/Period());
ArrayCopySeries(TimeArray ,MODE_TIME ,NULL,TimeFrame);
for(i=0,int y=0; i<limit; i++)
{
if(Time[i]<TimeArray[y]) y++;
sslHup[i] = iCustom(NULL,TimeFrame,IndicatorFileName,Lb,SSL_BarLevel,BarsSize,0,y);
sslHdn[i] = iCustom(NULL,TimeFrame,IndicatorFileName,Lb,SSL_BarLevel,BarsSize,1,y);
}
return(0);
}
for(i=Bars-Lb;i>=0;i--)
{
if(Close[i]>iMA(Symbol(),TimeFrame,Lb,0,MODE_SMA,PRICE_HIGH,i+1))
Hld = 1;
else
{
if(Close[i]<iMA(Symbol(),TimeFrame,Lb,0,MODE_SMA,PRICE_LOW,i+1))
Hld = -1;
else
Hld = 0;
}
if(Hld!=0)
Hlv = Hld;
if(Hlv == -1)
{
ssl[i] = iMA(Symbol(),TimeFrame,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
sslHdn[i] = SSL_BarLevel; sslHup[i]=EMPTY_VALUE;
}
else
{
ssl[i] = iMA(Symbol(),TimeFrame,Lb,0,MODE_SMA,PRICE_LOW,i+1);
sslHup[i] = SSL_BarLevel; sslHdn[i]=EMPTY_VALUE;
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments