wlxBWACsig_v2
Download scriptThis tool is designed to function as a visual signaling system on trading charts, specifically identifying potential trend reversals or significant momentum shifts based on historical price movements. Instead of cluttering the screen with constant lines, it places specific markers (arrows) only when precise mathematical conditions are met.
How the Logic Works
The script analyzes price data by looking back at a sequence of five consecutive data points. It treats these points as a "chain" to determine if the market is currently experiencing a specific type of structural change. The logic is divided into two main categories: signals for upward movement and signals for downward movement.
Upward Signal Identification The script searches for a specific "cup" formation in the data. It triggers a visual marker above the price when it detects one of three scenarios:
- A consistent series of positive movements where the values are steadily increasing toward the present.
- A transition from negative territory into a positive, rising trend.
- A specific complex pattern where a downward trend has peaked and begun a structured reversal upward.
Downward Signal Identification Conversely, the script searches for a "down" formation. It places a visual marker below the price when it detects:
- A consistent series of negative movements that are becoming increasingly lower.
- A transition from positive territory into a negative, falling trend.
- A specific complex pattern where an upward trend has peaked and begun a structured reversal downward.
Key Features for the User
- Visual Clarity: The tool uses different colors (Blue and Hot Pink) to distinguish between upward and downward signals, allowing for quick recognition at a glance.
- Automated Precision: Rather than requiring the trader to manually identify every peak and valley, the script automatically calculates the relationship between five points of data to confirm if a trend change is "strong" enough to be flagged.
- Customizable Sensitivity: The logic includes a buffer setting (the "updown" parameter). This allows you to adjust how far above or below the actual price candles the markers appear, ensuring they are clearly visible and do not overlap with the price action.
In summary, this script acts as an automated filter that scans historical price behavior to identify moments where the market structure shifts significantly, highlighting potential entry or exit points via visual cues.
//+------------------------------------------------------------------+
//| wlxBWACsig.mq4 |
//| Copyright © 2005 B.Williams, coding wellx |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005 B.Williams, coding wellx"
#property link "http://www.metaquotes.net"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 HotPink
//---- input parameters
extern int updown=8;
//---- buffers
double BWACup[];
double BWACdown[];
int pos=0;
double AC1,AC2,AC3,AC4,AC5;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,119);
SetIndexBuffer(0,BWACup);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,119);
SetIndexBuffer(1,BWACdown);
SetIndexEmptyValue(1,0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int cbars=IndicatorCounted();
if (cbars<0) return(-1);
if (cbars>0) cbars--;
//---- TODO: add your code here
if (cbars > (Bars-40)) pos=(Bars-40);
else pos=cbars;
// pos=10;
while(pos > 0)
{
BWACup[pos]=NULL;
BWACdown[pos]=NULL;
AC1=iAC(NULL,0,pos);
AC2=iAC(NULL,0,pos+1);
AC3=iAC(NULL,0,pos+2);
AC4=iAC(NULL,0,pos+3);
AC5=iAC(NULL,0,pos+4);
//----
if (((AC4>0 && AC3>0 && AC2>0 && AC1>0) && (AC4>AC3 && AC2>AC3 && AC1>AC2)) ||
((AC4<0 && AC3<0 && AC2<0 && AC1>0) && (AC4>AC3 && AC2>AC3 && AC1>AC2)) ||
((AC5<0 && AC4<0 && AC3<0 && AC2<0 && AC1<0) &&
(AC5>AC4 && AC4<AC3 && AC3<AC2 && AC2<AC1)))
BWACup[pos]=(High[pos]+updown*Point) ;
//----
if (((AC4<0 && AC3<0 && AC2<0 && AC1<0) && (AC4<AC3 && AC2<AC3 && AC1<AC2)) ||
((AC4>0 && AC3>0 && AC2>0 && AC1<0) && (AC4<AC3 && AC2<AC3 && AC1<AC2)) ||
((AC5>0 && AC4>0 && AC3>0 && AC2>0 && AC1>0) &&
(AC5<AC4 && AC4>AC3 && AC3>AC2 && AC2>AC1)))
BWACdown[pos]=(Low[pos]-updown*Point);
pos--;
}
return(0);
}
//+------------------------------------------------------------------+
Comments