$BIAS





//+------------------------------------------------------------------+ 
//|    $BIAS                                                         | 
//|                                                                  | 
//|                                                                  | 
//|   Copyright © 2008, Avery T. Horton, Jr. aka TheRumpledOne       |
//|                                                                  |
//|   PO BOX 43575, TUCSON, AZ 85733                                 |
//|                                                                  |
//|   GIFT AND DONATIONS ACCEPTED                                    | 
//|                                                                  |
//|   therumpldone@gmail.com                                         |  
//+------------------------------------------------------------------+ 
//|                                                                  |
//| go to www.kreslik.com for the latest indicator updates           |  
//+------------------------------------------------------------------+ 
//|                                                                  |
//| Use www.efxgroup.com as your forex broker...                     |  
//| ...tell them therumpledone sent you!                             |  
//+------------------------------------------------------------------+ 

#property copyright "Avery T. Horton, Jr. aka TheRumpledOne © 2008" 

#property link      "www.kreslik.com" 

#property indicator_separate_window

#property indicator_buffers 1

//---- input parameters 


//---- buffers

double _Value[];

//---- HARDWIRED  parameters 

 int MA_Fast = 5;
 int MA_MODE = MODE_EMA;
 int MA_PRICE_TYPE = 0;

//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         | 
//+------------------------------------------------------------------+ 
int init() 
  { 
   IndicatorBuffers(1);
   SetIndexBuffer(0,_Value);  
   SetIndexStyle(0,DRAW_LINE);  
   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| Custom indicator deinitialization function                       | 
//+------------------------------------------------------------------+ 
int deinit() 
  { 
//---- 
    
//---- 
   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| Custom indicator iteration function                              | 
//+------------------------------------------------------------------+ 


int start() 
  { 

 double BIAS_Curr = iMA(NULL,0,MA_Fast,0,MA_MODE,MA_PRICE_TYPE,0);
 double BIAS_Prev = iMA(NULL,0,MA_Fast,0,MA_MODE,MA_PRICE_TYPE,1);

//    if (iClose(NULL,0,0) >= BIAS_Curr )
    if (Close[0] >= BIAS_Curr )
    { if (BIAS_Curr >= BIAS_Curr) _Value[0] = 2;  else _Value[0] = 1; }
    else 
      if (BIAS_Curr < BIAS_Prev) _Value[0] = -2;  else _Value[0] = -1;  



//---- 
   return( 0 ); 
  } 
//+------------------------------------------------------------------+ 






Sample





Analysis



Market Information Used:

Series array that contains close prices for each bar


Indicator Curves created:


Implements a curve of type DRAW_LINE

Indicators Used:

Moving average indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: