wlxBWWiseMan-1_v1
Download scriptThis script is a custom technical analysis tool designed for the MetaTrader platform to help traders identify specific momentum shifts and price reversals by observing the relationship between market price and the "Alligator" indicator.
Core Logic Overview
The tool functions by scanning historical price data to find specific instances where the price action interacts with three distinct trend lines (representing the Alligator's lips, teeth, and jaw). It filters these interactions based on two main criteria: positional relationship to the trend lines and candlestick behavior.
How it identifies signals:
The script looks for two types of signals, represented by different colored arrows on your chart:
1. Upward Signals (Yellow Arrows): The tool identifies a potential upward move when the following conditions are met simultaneously:
- Price Position: The low price of the current candle stays above all three components of the Alligator indicator (Lips, Teeth, and Jaw).
- Candle Structure: The closing price of the candle is lower than its own midpoint (the average of its high and low), suggesting a specific type of price pressure.
- Trend Confirmation: The script then looks back at a specific number of previous candles (defined by the "back" setting). If the current candle's high is strictly higher than the highs of all those preceding candles, it confirms a localized peak and places a yellow arrow above the price.
2. Downward Signals (OrangeRed Arrows): Conversely, the tool identifies potential downward movement when:
- Price Position: The high price of the current candle stays below all three components of the Alligator indicator.
- Candle Structure: The closing price of the candle is higher than its own midpoint.
- Trend Confirmation: The script checks the previous candles (based on the "back" setting). If the current candle's low is strictly lower than the lows of those preceding candles, it confirms a localized trough and places an orange-red arrow below the price.
Key User Settings
- Updown: This determines the vertical distance from the candle where the arrows are drawn, ensuring they do not overlap with the actual price bars or other on-screen symbols.
- Back: This defines how many previous candles the script must analyze to confirm that a new high or low has been reached, helping to filter out minor price fluctuations and focus on more significant structural shifts.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| BW-wiseMan-1.mq4 |
//| Copyright © 2005, wellx |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, wellx"
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Yellow
#property indicator_color2 OrangeRed
extern int updown=5; //ñìåùåíèå èíäèêàòîðà ÷òîáû íå íàëåçàëíà äðóãèå çíà÷êè
extern int back=2; // êîë-âî áàðîâ äëÿ àíàëèçà íàçàä
//---- buffers
double BWWM1Up[];
double BWWM1Down[];
int pos=0;
int i=0;
bool contup=true,contdown=true;
//+-----------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,140);
SetIndexBuffer(0,BWWM1Up);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,140);
SetIndexBuffer(1,BWWM1Down);
SetIndexEmptyValue(1,0.0);
IndicatorDigits(6);
//----
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 == 0) return(0);
pos=cbars;
while (pos > 0)
{
BWWM1Up[pos]=NULL;
BWWM1Down[pos]=NULL;
if (
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, pos))
&&
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, pos))
&&
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, pos))
&&
(Close[pos]<((High[pos]+Low[pos])/2))
)
{
contup=true;
for(i=1; i <= back ;i++)
{
if (High[pos]<=High[pos+i])
{
contup=false;
break;
}
}
if (contup) BWWM1Up[pos]=(High[pos]+updown*Point);
}
if (
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, pos))
&&
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, pos))
&&
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, pos))
&&
(Close[pos]>((High[pos]+Low[pos])/2))
)
{
contdown=true;
for(i=1; i <= back ;i++)
{
if (Low[pos]>=Low[pos+i])
{
contdown=false;
break;
}
}
if (contdown) BWWM1Down[pos]=(Low[pos]-updown*Point);
}
pos--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments