super-signals_v3a_001

Download script
Author: alterations by Mark Tomlinson
super-signals_v3a_001

This indicator is designed to identify potential market turning points by monitoring price extremes over specific timeframes. It acts as a visual signaling system that highlights "highs" and "lows" based on historical price action, helping traders spot areas where the market might be overextended.

Core Logic Overview

The tool works by scanning the chart to find peak prices (highest highs) and valley prices (lowest lows) across two different measurement windows. By comparing these windows, the script distinguishes between short-term fluctuations and larger, more significant price movements.

1. Identifying Extremes The script looks at two distinct "distances" or periods of candles:

  • Short-Term Windows: These identify immediate price peaks and valleys to catch minor price shifts.
  • Long-Term Windows: These identify broader historical peaks and valleys, representing more significant market structures.

2. Dynamic Positioning When the script detects that a candle is one of these identified highs or lows, it places a visual marker (an arrow) on the chart. To ensure these markers are clearly visible and not overlapping with the price candles, it uses a volatility calculation (ATR). This ensures that the distance between the signal and the candle adjusts automatically based on how "choppy" or "smooth" the current market is.

Signal Interpretations

The logic categorizes signals into three distinct levels of intensity based on whether a short-term extreme and a long-term extreme occur at the same time:

  • Strong Signals: These occur when a price point qualifies as an extreme in both the short-term and long-term windows simultaneously. This suggests a significant structural reversal point.
  • Standard Signals: These occur when a price point is an extreme in only one of the windows, suggesting a more localized move.
  • Minor Signals / Exits: These are used to identify weaker movements, which can be interpreted as areas to potentially take profits or exit existing positions.

Notification System

The script includes a comprehensive alert system that monitors these conditions in real-time. It is programmed to recognize when a new signal appears and can be configured to notify the user through multiple channels:

  • On-Screen Pop-ups: Immediate visual alerts on the trading platform.
  • Audio Alerts: Sound notifications for hands-off monitoring.
  • Email Notifications: Sending signals directly to an inbox for remote monitoring.

The logic is built to ensure that the same signal isn't repeated multiple times; it identifies a unique event once and then waits for the next distinct price movement to trigger a new notification.

Indicators Used
Indicator of the average true range
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screenIt sends emailsIt plays sound alerts
12 Views
0 Downloads
0 Favorites
super-signals_v3a_001
//+------------------------------------------------------------------+
//|                                             super-signals_v2.mq4 |
//|                Copyright ?2006, Nick Bilak, beluck[AT]gmail.com  |
//|                               Modified by mtuppers[AT]gmail.com  |
//|			                took away time, add periods  |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006, Nick Bilak"
#property copyright "alterations by Mark Tomlinson"
#property link      "http://www.forex-tsd.com/"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Yellow
#property indicator_color2 Lime
#property indicator_color3 Red
#property indicator_color4 Aqua
#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1
#property indicator_width4 1

//input properties

extern int  dist2           = 21;
extern int  dist1           = 14;
extern bool alertsOn        = false;
extern bool alertsOnCurrent = true;
extern bool alertsMessage   = true;
extern bool alertsSound     = false;
extern bool alertsEmail     = false;

double b1[];
double b2[];
double b3[];
double b4[];


int init()
{
   SetIndexBuffer(0,b1);
   SetIndexBuffer(1,b2);
   SetIndexBuffer(2,b3);
   SetIndexBuffer(3,b4);
   SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,334);
   SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,333);
   SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(1,233);
   SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(0,234);
   return(0);
}
int start()
{
   int counted_bars=IndicatorCounted();
   int i,limit,hhb,llb,hhb1,llb1;

   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
           limit=Bars-counted_bars;
           limit=MathMax(limit,dist1);
           limit=MathMax(limit,dist2);

   //
   //
   //
   //
   //

   for (i=limit;i>=0;i--)
      {
         hhb1 = Highest(NULL,0,MODE_HIGH,dist1,i-dist1/2);
         llb1 = Lowest(NULL,0,MODE_LOW,dist1,i-dist1/2);
         hhb  = Highest(NULL,0,MODE_HIGH,dist2,i-dist2/2);
         llb  = Lowest(NULL,0,MODE_LOW,dist2,i-dist2/2);

            b1[i] = EMPTY_VALUE;
            b2[i] = EMPTY_VALUE;
            b3[i] = EMPTY_VALUE;
            b4[i] = EMPTY_VALUE;
      
         double tr = iATR(NULL,0,50,i);
         if (i==hhb)  b1[i]=High[hhb] +tr;
         if (i==llb)  b2[i]=Low[llb]  -tr;
         if (i==hhb1) b3[i]=High[hhb1]+tr/2;
         if (i==llb1) b4[i]=Low[llb1] -tr/2;
      }
      
   //
   //
   //
   //
   //
   
   if (alertsOn)
      {
         int forBar = 1;
            if (alertsOnCurrent) forBar = 0;
            if (b1[forBar] != EMPTY_VALUE && b3[forBar] != EMPTY_VALUE) doAlert("strong sell");
            if (b1[forBar] != EMPTY_VALUE && b3[forBar] == EMPTY_VALUE) doAlert("sell");
            if (b1[forBar] == EMPTY_VALUE && b3[forBar] != EMPTY_VALUE) doAlert("minor sell or exit buy");
            if (b2[forBar] != EMPTY_VALUE && b4[forBar] != EMPTY_VALUE) doAlert("strong buy");
            if (b2[forBar] != EMPTY_VALUE && b4[forBar] == EMPTY_VALUE) doAlert("buy");
            if (b2[forBar] == EMPTY_VALUE && b4[forBar] != EMPTY_VALUE) doAlert("minor buy or exit sell");
      }
  return(0);
}

//
//
//
//
//

void doAlert(string doWhat)
{
   static string   previousAlert="nothing";
   static datetime previousTime;
   string message;
   
      if (previousAlert != doWhat || previousTime != Time[0]) {
          previousAlert  = doWhat;
          previousTime   = Time[0];

          //
          //
          //
          //
          //

          message =  StringConcatenate(Symbol()," at ", Period(), " m Super signal : ",doWhat);
             if (alertsMessage) Alert(message);
             if (alertsEmail)   SendMail(StringConcatenate(Symbol(),"Super signal "),message);
             if (alertsSound)   PlaySound("alert2.wav");
      }
}

Comments