MA_PriceCcrossHiLo
Download scriptThis tool is designed to provide a visual guide for traders by identifying specific price action relationships relative to a moving average. It helps users distinguish between moments where the market is trending smoothly and points where it may be experiencing significant "gaps" or deviations from its average path.
Core Functionality
The script operates by calculating a Moving Average—a smoothed line that represents the general direction of the market over a specific period. This line serves as the primary benchmark for all other calculations.
How It Identifies Market Activity
The tool continuously monitors three specific conditions to provide visual feedback on your chart:
- The Baseline (Moving Average): The script plots a continuous line that tracks the average price of the assets. This allows you to see the immediate trend at a glance.
- Upper Deviations: The script looks for instances where the market's "low" price remains entirely above the Moving Average line. When this happens, it places a specific visual marker (an arrow) on the chart. This highlights areas where the price is moving aggressively upward and staying well clear of its average.
- Lower Deviations: Conversely, the script monitors for moments where the market's "high" price remains entirely below the Moving Average line. It marks these instances with a different set of visual markers, indicating sections where the price is trending downward with significant momentum, staying away from the average path.
Summary for the User
In simple terms, this indicator does more than just show you a trend line; it acts as an alert system for "clean" price movements. Instead of showing every minor fluctuation, it highlights specific zones where the market has broken away from its average. This allows you to quickly identify periods of high-momentum growth or sharp decline, helping you spot potential breakout points or sustained trends more effectively.
//+------------------------------------------------------------------+
//| MA_xP |
//+------------------------------------------------------------------+
//2008fxtsd ki
#property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Gold
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_width2 2
#property indicator_width3 2
extern int ma_period =9;
extern int ma_method =1;
extern int ma_price =0;
double Buffer1[];
double Buffer2[];
double Buffer3[];
//+---
int init()
{
SetIndexBuffer(0,Buffer1); SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1,Buffer2); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,158); SetIndexEmptyValue (1,EMPTY_VALUE);
SetIndexBuffer(2,Buffer3); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,158); SetIndexEmptyValue (2,EMPTY_VALUE);
return(0);
}
//+----
int deinit()
{
return(0);
}
int start()
{
int i,limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit = Bars-counted_bars;
for(i=limit; i>=0; i--)
{
double MA=iMA(NULL,0,ma_period,0,ma_method,ma_price,i) ;
Buffer1[i] = MA;
Buffer2[i] = EMPTY_VALUE;
Buffer3[i] = EMPTY_VALUE;
if (High[i]<MA) Buffer2[i]= MA;
if (Low [i]>MA) Buffer3[i]= MA;
}
return(0);
}
//+---------------
Comments