###Gann_HiLo_Activator_v2###~
Download scriptThis tool is designed as a visual aid for traders who want to identify potential price boundaries or "zones of interest" on their charts. Instead of simply looking at standard averages, this script focuses on the relationship between the current closing price and specific high and low price points over a set period.
How it Works
The logic functions by scanning the historical price data (based on a user-defined "Lookback" period) to determine the prevailing trend or momentum of the market. It constantly compares the most recent price at which a candle closed against two different moving averages: one calculated based on the highest prices reached and another based on the lowest prices reached.
The Decision Logic
The script categorizes the market movement into three distinct states:
- Upward Bias: If the closing price is higher than the average of the previous high points, the script recognizes a bullish sentiment. In this scenario, it identifies the "High" average as a key reference point.
- Downward Bias: If the closing price drops below the average of the previous low points, the script recognizes a bearish sentiment and identifies the "Low" average as the primary reference point.
- Neutral State: If the price falls into between these two averages without breaking either threshold, the script remains neutral.
Visual Output
Once the script determines which trend is dominant (Upward or Downward), it projects a specific value onto the chart. This value represents either the "High" average or the "Low" average of the current period.
Essentially, the tool filters out market noise to provide a dynamic line that shifts based on whether the price is pushing toward the top or bottom of its recent range. It also displays the most recent calculated value as a text comment on your screen, allowing you to see the exact numerical level at a glance.
/*
Generated by EX4-TO-MQ4 decompiler ONE FILE V4.0.218.3
EX4 ID : 04E20A41724C2645BAEB3FDF008C44EC
Website: http://purebeam.biz
E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Blue
extern int Lookback = 10;
double g_ibuf_80[];
int gi_unused_84 = 0;
int init() {
SetIndexBuffer(0, g_ibuf_80);
string ls_0 = "TESTING";
IndicatorShortName(ls_0);
return (0);
}
int deinit() {
return (0);
}
int start() {
int li_4;
int li_8;
for (int li_0 = Bars - Lookback; li_0 >= 0; li_0--) {
if (Close[li_0] > iMA(NULL, 0, Lookback, 0, MODE_SMA, PRICE_HIGH, li_0 + 1)) li_8 = 1;
else {
if (Close[li_0] < iMA(NULL, 0, Lookback, 0, MODE_SMA, PRICE_LOW, li_0 + 1)) li_8 = -1;
else li_8 = 0;
}
if (li_8 != 0) li_4 = li_8;
if (li_4 == -1) g_ibuf_80[li_0] = iMA(NULL, 0, Lookback, 0, MODE_SMA, PRICE_HIGH, li_0);
else g_ibuf_80[li_0] = iMA(NULL, 0, Lookback, 0, MODE_SMA, PRICE_LOW, li_0);
}
Comment("HiLo= ", g_ibuf_80[li_0 + 1]);
return (0);
}
Comments