Phat_TD_REI

Download script
Author: lowphat
Phat_TD_REI

This custom technical indicator is designed to provide traders with a visual representation of market sentiment and price momentum by categorizing trading activity into three distinct zones. It functions as a secondary analysis tool, appearing in a separate window below the main price chart to help filter out "market noise" and identify clear directional trends.

How the Logic Works

The script operates by analyzing data from a primary underlying calculation (the TD_REI) and sorting that data into three specific color-coded categories based on pre-defined numerical thresholds. These thresholds allow the user to distinguish between strong bullish sentiment, neutral market activity, and strong bearish sentiment.

1. The Green Zone (Bullish Momentum) When the underlying indicator value reaches or exceeds a specific positive threshold (the "NeutralZone"), the script identifies this as a strong bullish signal. On your chart, this is represented by green histogram bars. It indicates that price momentum is moving significantly upward.

2. The White Zone (Neutral Activity) The script identifies a "buffer" area where market activity is considered indecisive or balanced. If the values fall between the negative and positive limits of the NeutralZone, they are displayed as white bars. This helps traders recognize periods of consolidation or sideways movement where no clear trend is established.

3. The Red Zone (Bearish Momentum) Conversely, when the underlying indicator value drops below a specific negative threshold, the script flags this as strong bearish momentum. This is represented by red histogram bars, signaling that the downward pressure on the market is significant.

Summary of Visual Behavior

Instead of showing you every minor fluctuation in price, this tool simplifies the market into three clear visual states:

  • Green: Active upward movement.
  • White: Neutral or sideways movement.
  • Red: Active downward movement.

By using these color-coded bars, the script allows for a quick, at-a-glance assessment of market conditions, helping you identify which "zone" the current price action belongs to without having to manually calculate trend strengths.

Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
Phat_TD_REI
//+------------------------------------------------------------------+ 
//|                                                                  | 
//+------------------------------------------------------------------+ 
#property copyright "lowphat" 
#property link      "forextrash@yahoo.com" 
#property indicator_separate_window
//#property indicator_chart_window 
#property indicator_buffers 4 
#property indicator_color1 Lime 
#property indicator_color2 Green
#property indicator_color3 Red
#property indicator_color4 White
//---- input parameters 

extern int NeutralZone = 45;
extern int Level = 8;

//---- buffers 
double main[]; 
double green[]; 
double red[];
double white[];
datetime daytimes[]; 
//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         | 
//+------------------------------------------------------------------+ 
int init() 
  { 
//---- indicators 
   SetIndexStyle(0,DRAW_LINE); 
   SetIndexArrow(0,158); 
   SetIndexBuffer(0,main); 
   
   SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexArrow(2, 250);   
   SetIndexBuffer(2,green);  
   SetIndexEmptyValue(0,0.0); 
   
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexArrow(1, 250);   
   SetIndexBuffer(1,red);  
   SetIndexEmptyValue(0,0.0); 
   
   SetIndexStyle(3,DRAW_HISTOGRAM);
   SetIndexArrow(3, 250);   
   SetIndexBuffer(3,white);  
   SetIndexEmptyValue(0,0.0); 
  
   IndicatorShortName("||-Phat TD_REI-||-Zone(+/-"+NeutralZone+")-||-Level(+/-"+Level+")-||"); 
      return(0); 
  } 
      int deinit() 
  { 
      return(0); 
  } 
      int start() 
  { 
      int    limit, bigshift; 
      int    counted_bars=IndicatorCounted(); 
//---- 
      if (counted_bars<0) return(-1); 
      if (counted_bars>0) counted_bars--; 
     limit=Bars-counted_bars; 
      for (int i=0; i<limit; i++) 
   { 
     main[i]=iCustom(NULL,0,"TD_REI",Level,0,i); 

      if (main[i] >= NeutralZone )
     green[i] = main[i];
      else
     green[i] = 0;
      if (main[i] < NeutralZone && main[i] > -NeutralZone )
     white[i] = main[i];
      else
     white[i] = 0;   
      if (main[i] < -NeutralZone )
     red[i] = main[i];
      else
     red[i]=0; 
        }
   return(0); 
  } 

Comments