super-signals - adjustable
Download scriptThis script is designed as a visual navigation tool for traders to identify significant "turning points" or extremes in price action on a trading chart. Rather than predicting future movements, it highlights historical peaks and valleys based on specific mathematical boundaries.
How the Logic Works
1. Identifying Price Extremes The core logic of the tool revolves around scanning the market history to find the highest and lowest prices within a specific window of time (defined by the "distance" setting). Think of it as the script looking at a moving "frame" of candles; it constantly asks, "Where was the highest point in this section?" and "Where was the lowest point?"
2. Signal Placement When the script identifies a candle that represents the highest peak or the lowest trough within that specific timeframe, it places a visual marker on the chart:
- High Points: A signal is placed above the highest price reached to highlight a local ceiling.
- Low Points: A signal is placed below the lowest price reached to highlight a local floor.
3. Dynamic Spacing To ensure that these markers don't overlap with the actual candles and remain easy for the human eye to see, the script calculates the necessary "padding" or gap. It uses a volatility measurement (ATR) to determine how much space to put between the price candle and the signal arrow. This means that during periods of high market volatility, the arrows will be further away from the candles, while in calmer markets, they will sit closer.
Summary for the User
Essentially, this tool acts as an automated "high-water mark" and "low-water mark" scanner. It filters out the noise of minor price fluctuations to highlight the most prominent peaks and valleys over a set period, providing a clear visual map of where the market reached its extremes.
//+------------------------------------------------------------------+
//| super-signals.mq4 |
//| Copyright © 2006, Nick Bilak, beluck[AT]gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Nick Bilak"
#property link "http://www.forex-tsd.com/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Aqua
extern int dist=24;
extern double arrowPosition = 0.25;
double b1[];
double b2[];
int init() {
SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);
SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);
SetIndexArrow(1,233);
SetIndexArrow(0,234);
SetIndexBuffer(0,b1);
SetIndexBuffer(1,b2);
return(0);
}
int start() {
int counted_bars=IndicatorCounted();
int k,i,j,limit,hhb,llb;
if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
limit=Bars-counted_bars-1;
limit=MathMax(limit,dist);
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]+iATR(NULL,0,10,i)*arrowPosition; else b1[i]=EMPTY_VALUE;
if (i==llb) b2[i]=Low[llb] -iATR(NULL,0,10,i)*arrowPosition; else b2[i]=EMPTY_VALUE;
}
return(0);
}
Comments