wlxBWWiseMan-1_v2

Author: Copyright � 2005, wellx
wlxBWWiseMan-1_v2

This tool is designed as a visual indicator for the MetaTrader platform, specifically created to help traders identify potential trend reversals or structural shifts by analyzing price action in relation to a specific technical moving average framework.

Core Logic Overview

The script functions by monitoring the relationship between current market prices and three distinct components of an "Alligator" moving average system (commonly referred to as the Lips, Teeth, and Jaw). It seeks to identify specific moments where the price "breaks out" or retreats from these averages while simultaneously confirming a change in momentum.

How it Identifies Signals

The indicator scans each historical price candle to see if two specific conditions are met:

1. For Upward Signals (Bullish Momentum):

  • Price Positioning: The low of the current candle must be higher than all three components of the Alligator averages. This suggests that the price is moving upward and staying above the established "baseline."
  • Candle Structure: The closing price of the candle must be in the lower half of its total range (the midpoint between the high and low).
  • Trend Confirmation: The script then looks back at a specific number of previous candles (defined by the user). It only places an arrow if the current candle's high is higher than all those previous highs, confirming that a new peak is being formed.

2. For Downward Signals (Bearish Momentum):

  • Price Positioning: The high of the current candle must be lower than all three components of the Alligator averages. This suggests the price is retreating and staying below the "baseline."
  • Candle Structure: The closing price of the candle must be in the upper half of its total range (the midpoint between the high and low).
  • Trend Confirmation: Similar to the upward signal, the script looks back at previous candles. It only places an arrow if the current candle's low is lower than all those previous lows, confirming a new trough is being formed.

Visual Output

Once the logic confirms these conditions:

  • An Yellow arrow is placed above the price to signify a potential upward move.
  • An OrangeRed arrow is placed below the price to signify a potential downward move.

The distance of these arrows from the candles can be adjusted by the user, ensuring they are clearly visible and do not overlap with other trading symbols or indicators on the chart.

Indicators Used
Bill Williams Alligator
Miscellaneous
Implements a curve of type %1
16 Views
0 Downloads
0 Favorites
wlxBWWiseMan-1_v2
//+------------------------------------------------------------------+
//|                                                 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