Author: � RickD BJF Trading Group 2006
i-OneThird

This technical indicator, titled "One Third," is designed to analyze price action by identifying the momentum and positioning of a candle relative to its total range. Instead of simply looking at where the price opens or closes, the logic focuses on whether the price spent the majority of its movement moving in a specific direction.

Core Methodology

The script operates by dividing the vertical distance between a candle's highest point (High) and its lowest point (Low) into three equal parts. This "one-third" division acts as a threshold to determine if a candle is considered "bullish" or "bearish" based on its closing strength rather than just its color.

How the Logic Works

The indicator scans each price bar on the chart and performs the following checks:

  • Bullish Momentum Identification: If the closing price of a candle is positioned in the upper third of its total range (specifically, if it closes above the level reached by subtracting one-third of the range from the high), the script identifies this as a strong upward movement. In these instances, it captures the low and high points to define the boundaries of that upward momentum.

  • Bearish Momentum Identification: Conversely, if the closing price falls into the lower third of the candle's total range (closing below the level reached by adding one-third of the range to the low), the script identifies this as a strong downward movement. It then captures the high and low points to highlight the boundaries of that downward pressure.

Visual Representation

The logic translates these calculations into four distinct visual data streams on your chart:

  1. It tracks the primary boundaries (the Highs and Lows) of the candles that meet the momentum criteria.
  2. It identifies the "body" of those specific candles by calculating the minimum and maximum between the opening and closing prices.

By filtering out candles that close near the middle of their range, the indicator highlights only the price bars where there was a definitive shift in direction, providing a clearer picture of market sentiment.

Miscellaneous
Implements a curve of type %1
17 Views
0 Downloads
0 Favorites
i-OneThird
//+--------------------------------------------------------------------------------------+
//                                                             O N E      T H I R D      |
//                                        Copyright © RickD  BJF Trading Group 2006      |
//                                                             http://fxstrategy.ca      |
//                                                                                       |
//Experts http://fxstrategy.ca/experts.php      SALE! 50% OFF                            |
//Indicators http://fxstrategy.ca/products.php  SALE!50% OFF                             |
//Digital Filters Strategy http://fxstrategy.ca/digital_filtrs.php  SALE!50% OFF         |
//Trading Signals http://fxstrategy.ca/signals.php Two weeks FREE! No CC.                |
// forex calendar, research, article ....                                                |
//+--------------------------------------------------------------------------------------+
#property copyright "© RickD  BJF Trading Group 2006"                                    
#property link      "http://fxstrategy.ca/products.php"
//----
#define major   1
#define minor   0
//----
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 OrangeRed
#property indicator_color2 DodgerBlue
#property indicator_color3 OrangeRed
#property indicator_color4 DodgerBlue
//----
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void init()
  {
   SetIndexBuffer(0, ExtMapBuffer1);
   SetIndexBuffer(1, ExtMapBuffer2);
   SetIndexBuffer(2, ExtMapBuffer3);
   SetIndexBuffer(3, ExtMapBuffer4);
//----        
   SetIndexStyle(0, DRAW_HISTOGRAM, 0, 1);
   SetIndexStyle(1, DRAW_HISTOGRAM, 0, 1);
   SetIndexStyle(2, DRAW_HISTOGRAM, 0, 3);
   SetIndexStyle(3, DRAW_HISTOGRAM, 0, 3);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void deinit()
  {
//----
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void start()
  {
   int counted = IndicatorCounted();
   if(counted < 0) 
     return (-1);
//----  
   if (counted > 0) 
     counted--;
   int limit = Bars-counted;
//----  
   for(int i = 0; i < limit; i++) 
     {
       double third = (High[i] - Low[i]) / 3;
       //----
       if(Close[i] > High[i] - third)
         {
           ExtMapBuffer1[i] = Low[i];
           ExtMapBuffer2[i] = High[i];
           ExtMapBuffer3[i] = MathMin(Open[i], Close[i]);
           ExtMapBuffer4[i] = MathMax(Open[i], Close[i]);
         } 
       //----
       if(Close[i] < Low[i] + third)
         {
           ExtMapBuffer1[i] = High[i];
           ExtMapBuffer2[i] = Low[i];
           ExtMapBuffer3[i] = MathMax(Open[i], Close[i]);
           ExtMapBuffer4[i] = MathMin(Open[i], Close[i]);
         }
     }
  }  
//+------------------------------------------------------------------+

Comments