HeartBeat
Download scriptThis indicator is designed to help traders identify underlying momentum and price trends by utilizing a specialized calculation based on the Elliott Wave theory. Instead of just looking at raw price movements, it focuses on the "force" behind the price to provide a smoother, more readable visual representation of market activity.
Core Functionality
The script calculates the change in market momentum over a specific timeframe. It looks at the difference between the current "force" of the market and the force from the previous period. By measuring this change, it aims to filter out minor price fluctuations (market noise) and highlight significant directional shifts.
Adaptive Sensitivity
One of the key features of this tool is its ability to automatically adjust its sensitivity based on the timeframe you are viewing. The logic recognizes different trading horizons:
- Short-term View (1-minute charts): It uses very precise, tight boundaries to capture rapid price micro-movements.
- Medium to Long-term Views (5-minute to 60-minute charts): It automatically widens its boundaries and adjusts its multipliers to ensure that the data remains readable and meaningful across different scales of time.
Noise Filtering Logic
To ensure the indicator provides clear signals rather than cluttered data, it employs a filtering system:
- Boundary Limits: The script establishes "upper" and "lower" thresholds based on the current timeframe.
- Signal Suppression: If the calculated market force is too small—meaning it falls within a specific "neutral zone"—the indicator treats the value as zero. This prevents minor, insignificant price wiggles from creating false signals on your chart.
- Momentum Scaling: Once a movement exceeds these neutral boundaries, the script applies a multiplier to the data, making significant trends more visually prominent for the trader.
Visual Output
The result is a smooth line displayed in a separate window below your main price chart. This line represents the "net force" of the market. When the line moves significantly away from zero, it indicates a stronger trend; when it stays near zero, it suggests a period of consolidation or lack of significant momentum.
//+------------------------------------------------------------------+
//| Elliott Wave Oscillator.mq4 |
//| tonyc2a@yahoo.com |
//| |
//+------------------------------------------------------------------+
#property copyright "tonyc2a@yahoo.com"
#property link ""
#property indicator_separate_window
#property indicator_color1 LightBlue
//---- buffers
double Buffer1[];
double forcey=0;
double upper=0.04;
double lower=-0.04;
double multiplicant=1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);
SetIndexBuffer(0,Buffer1);
SetIndexLabel(0,"EWO");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
//#property indicator_maximum 0.07
//#property indicator_minimum -0.07
int start()
{
int counted_bars=IndicatorCounted();
if (Period()==30)
{
upper=0.2;
lower=-0.2;
}
if (Period()==60)
{
upper=0.3;
lower=-0.3;
}
if (Period()==5)
{
upper=0.0100;
lower=-0.0100;
multiplicant=5;
}
if (Period()==1)
{
upper=0.0005;
lower=-0.0005;
}
//---- TODO: add your code here
for(int i=300 ;i>=0;i--)
{
forcey=iForce(NULL,0,7,0,PRICE_CLOSE,i)-iForce(NULL,0,7,0,PRICE_CLOSE,i+1);
if (forcey > 0 && forcey < upper) forcey=0;
if (forcey < 0 && forcey > lower) forcey=0;
Buffer1[i]=forcey*multiplicant;
if (i==0 && forcey !=0)
{
//PlaySound("alert2.wav");
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments