#MTF_Super-signals_v1_001
Download scriptOverview
The Super-Signals tool is a technical analysis indicator designed to help traders identify significant price extremes—specifically local highs and lows—on a trading chart. It functions by scanning the market history to pinpoint where the price reached its peak or trough within a specific moving window, providing visual cues for potential trend reversals or breakouts.
Core Logic & Functionality
The script operates using three primary mechanical components:
1. Multi-Timeframe Synchronization One of the key features of this tool is its ability to analyze data from different time horizons. While you may be looking at a small, fast-moving chart (like a 5-minute candle), the script can be configured to "look ahead" and identify signals based on larger intervals, such as the Hourly or Daily periods. This allows traders to ensure that their actions align with the broader market structure.
2. Dynamic Peak and Trough Identification The indicator uses a mathematical "Lookback" window (defined by a set distance of bars). As it moves across the chart:
- High Points: It identifies the highest price reached within that specific window. When it detects the current bar is the highest in that range, it generates a signal (represented visually on the chart).
- Low Points: Similarly, it identifies the lowest price reached within that same window. When the current bar hits that bottom point, it generates a corresponding opposite signal.
3. Automated Alerts and Visual Markers To ensure traders do not have to constantly watch the screen, the script provides two layers of notification:
- Visual Cues: It places distinct arrows (Red and Yellow) directly on your chart to highlight exactly where the peaks and troughs occurred.
- Real-Time Alerts: The tool includes a built-in notification system. When a new "Up" or "Down" signal is confirmed on the most recent candle, it triggers a pop-up alert on your trading platform. This helps you react immediately to price action shifts without being glued to the screen.
Summary for the User
Essentially, this tool acts as an automated "scout." It constantly scans the market's recent history to tell you: "This is the highest point we have seen in X amount of time" or "This is the lowest point we have seen in X amount of time." By identifying these turning points automatically, it simplifies the process of spotting potential trend changes across various timeframes.
//+------------------------------------------------------------------+
//| super-signals.mq4 |
//| Copyright © 2006, Nick Bilak, beluck[AT]gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Nick Bilak converted by Suresh"
#property link "http://www.forex-tsd.com/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Yellow
#property indicator_width1 5
#property indicator_width2 5
//---- input parameters
/*************************************************************************
PERIOD_M1 1
PERIOD_M5 5
PERIOD_M15 15
PERIOD_M30 30
PERIOD_H1 60
PERIOD_H4 240
PERIOD_D1 1440
PERIOD_W1 10080
PERIOD_MN1 43200
You must use the numeric value of the timeframe that you want to use
when you set the TimeFrame' value with the indicator inputs.
**************************************************************************/
extern int TimeFrame=0;
extern int SignalGap = 1;
int dist=24;
double b1[];
double b2[];
double prev;
double alertBar;
int init()
{
SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID);
SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID);
SetIndexArrow(1,233);
SetIndexArrow(0,234);
SetIndexBuffer(0,b1);
SetIndexBuffer(1,b2);
//---- name for DataWindow and indicator subwindow label
switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
IndicatorShortName("MTF_Super-Signals_v1 ("+TimeFrameStr+")");
}
//----
return(0);
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit=Bars-counted_bars;
for(i=0,y=0;i<limit;i++)
{
if (Time[i]<TimeArray[y]) y++;
/***********************************************************
Add your main indicator loop below. You can reference an existing
indicator with its iName or iCustom.
Rule 1: Add extern inputs above for all neccesary values
Rule 2: Use 'TimeFrame' for the indicator time frame
Rule 3: Use 'y' for your indicator's shift value
**********************************************************/
int k,j,hhb,llb;
if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
limit=Bars-1;
if(counted_bars>=1) limit=Bars-counted_bars-1;
if (limit<0) limit=0;
for (i=limit;i>=0;i--) {
hhb = Highest(NULL,0,MODE_HIGH,dist,i-dist/2);
llb = Lowest(NULL,0,MODE_LOW,dist,i-dist/2);
if (i==hhb){
b1[i]=High[hhb]+SignalGap*Point;
if(i==1 && Bars>alertBar) Alert("Super Signals going Down on ",Symbol()," Period ",Period());
alertBar = Bars;
}
if (i==llb){
b2[i]=Low[llb]-SignalGap*Point;
if(i==1 && Bars>alertBar) Alert("Super Signals going Up on ",Symbol()," Period ",Period());
alertBar = Bars;
}
}
return(0);
}
}
//+------------------------------------------------------------------+
Comments