wlxBWAOsig





//+------------------------------------------------------------------+
//|                                                   wlxBWAOsig.mq4 |
//|                        Copyright © 2005 B.Williams, coding wellx |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005 B.Williams, Degtyarev V, coding 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;
//---- buffers
double BWAOup[];
double BWAOdown[];

int pos=0;
double AO,AO1,AO2;
double TPicksUP=0.0, TPicksDown=0.0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,167);
   SetIndexBuffer(0,BWAOup);
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,167);
   SetIndexBuffer(1,BWAOdown);
   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 > (Bars-40)) pos=(Bars-40);
   else pos=cbars;
//   pos=10;
   while (pos > 0)
   {
    BWAOup[pos]=NULL;
    BWAOdown[pos]=NULL;    
    AO=iAO(NULL,0,pos);
    AO1=iAO(NULL,0,pos+1);
    AO2=iAO(NULL,0,pos+2);
   
    if ((AO2>0.0 && AO1>0.0 && AO>0.0) && (AO2>AO1 && AO>AO1)) BWAOup[pos]=(High[pos]+updown*Point);
    if (AO1<0.0 && AO>0.0) BWAOup[pos]=(High[pos]+updown*Point);
    
    if ((AO2<0.0 && AO1<0.0 && AO<0.0) && (AO2<AO1 && AO<AO1)) BWAOdown[pos]=(Low[pos]-updown*Point); 
    if (AO1>0.0 && AO<0.0) BWAOdown[pos]=(Low[pos]-updown*Point); 
    
    if (AO>0.0 && TPicksUP!=0.0) TPicksUP=0.0;
    if (AO<0.0 && TPicksDown!=0.0) TPicksDown=0.0;
   
    if ((AO2<0.0 && AO1<0.0 && AO < 0.0) && (AO2>AO1 && AO>AO1)) {
       if (AO1>TPicksUP) BWAOup[pos]=(High[pos]+updown*Point);
       TPicksUP=AO1;
    }
    if ((AO2>0.0 && AO1>0.0 && AO > 0.0) && (AO2<AO1 && AO<AO1)) {
       if (AO1<TPicksDown) BWAOdown[pos]=(Low[pos]-updown*Point);
       TPicksDown=AO1;
    }
    
    pos--;  
   }
   
   
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar


Indicator Curves created:

Implements a curve of type DRAW_ARROW


Indicators Used:

Bill Williams Awesome oscillator


Custom Indicators Used:

Order Management characteristics:

Other Features: