Waterfall [i]
Download scriptThis script is designed to act as a visual signaling tool on your trading charts, specifically identifying high-priority price points for potential analysis. Instead of drawing complex lines or moving averages, it places specific red arrow markers at precise locations on the chart based on historical price behavior.
How the Logic Works
The tool operates by scanning the price history of the currency pair or asset you are currently viewing. Here is the step-by-step breakdown of its internal logic:
1. Price Range Analysis The script continuously looks at the "candles" (the vertical bars) on your chart. For every candle, it calculates the total distance between the highest price reached and the lowest price reached during that specific time frame.
2. The 20% Threshold Calculation Once the range of a candle is determined, the script calculates a specific "floor" value. It identifies a point exactly 20% above the bottom of that candle's range. This serves as the internal mathematical benchmark for the tool.
3. Identifying Peaks (The Trigger) The core intelligence of this script lies in its ability to detect significant price peaks. It looks back at the last 50 candles on the chart to determine if a specific high point is a standout maximum.
4. Visual Signaling When the script detects that a candle's high represents a significant peak within that 50-bar window, it triggers a visual action. It places a red arrow directly on the chart at that specific high price point.
Summary for the User
In simple terms, this tool highlights "breakout" levels or historical peaks. By marking these specific points with red arrows, it allows you to quickly identify where the price has reached significant highs in the recent past without having to manually scan through dozens of candles. It filters out minor price fluctuations and only marks the areas that stand out as local maximums.
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
double BufferBuy[];
int init()
{
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_ARROW);
SetIndexBuffer(0,BufferBuy);
SetIndexArrow(0,181);
SetIndexEmptyValue(0,0.0);
ArraySetAsSeries(BufferBuy,true);
return(0);
}
int deinit()
{
return(0);
}
int start()
{
int i,TotalBars, CountedBars;
double LastBarsRange,Bottom20;
CountedBars=IndicatorCounted();
TotalBars=Bars-CountedBars;
for(i=TotalBars-1;i>=0;i--)
{
LastBarsRange=(High[i+1]-Low[i+1]);
Bottom20=Low[i+1]+(LastBarsRange*0.20);
if(Highest(Symbol(),0,MODE_HIGH,50,1)==1)
BufferBuy[i]=High[i];
}
}
Comments