$MID
Download scriptThis tool functions as a momentum and sentiment tracker designed to help traders visualize the relationship between current market prices and recent price boundaries. Instead of cluttering your main chart with complex numbers, it provides a clear, simplified signal by comparing where the market is currently trading against where it was just moments before.
How the Logic Works
The core functionality of this script relies on identifying a specific "pivot point" from the previous completed candle. It calculates the midpoint between that candle's highest and lowest price points. This midpoint acts as a neutral benchmark—essentially a "fair value" line for that specific period of time.
Once this benchmark is established, the script evaluates the current market action against it to determine the output:
- Positive Signal: If the current closing price moves above this previous midpoint, the indicator identifies an upward trend or bullish momentum.
- Negative Signal: If the current closing price falls below that same midpoint, the indicator reflects a downward trend or bearish momentum.
- Neutral State: In the rare event that the price is exactly on the midpoint, the indicator remains at zero, signifying a state of equilibrium.
Purpose for the Trader
By filtering out the "noise" of minor fluctuations and focusing purely on whether the price has broken above or below the previous candle's center, this tool provides a streamlined way to view market direction. It translates raw historical data into a continuous visual line, allowing you to see at a glance whether the current price action is stronger than the preceding movement.
//+------------------------------------------------------------------+
//| $MID |
//| |
//| |
//| 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[];
//+------------------------------------------------------------------+
//| 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()
{
int i, dayi, counted_bars = IndicatorCounted();
//---- check for possible errors
if(counted_bars < 0)
return(-1);
//---- last counted bar will be recounted
if(counted_bars > 0)
counted_bars--;
int limit = Bars - counted_bars;
//----
for(i = limit - 1; i >= 0; i--)
{
double _Result = ( High[i+1] + Low[i+1] ) * 0.50 ;
if ( Close[i] > _Result ) _Value[i] = 1;
else {
if ( Close[i] < _Result ) _Value[i] = -1;
else _Value[i] = 0; }
}
//----
return( 0 );
}
//+------------------------------------------------------------------+
Comments