LineFrakUp
Download scriptThis script is designed to automatically identify and visualize key price resistance levels on a trading chart. It functions by scanning the historical price data to find specific "fractal" points—these are peak price movements where the high of a candle is significantly higher than the highs of the candles immediately surrounding it.
How the Logic Works:
- Fractal Identification: The script actively searches backwards through the chart's history to locate two distinct fractal peaks. It looks for these "turning points" in the price action to determine where the market previously reached a high and began to pull back.
- Dynamic Scanning: Instead of looking at just one point, the script moves progressively backward in time (candle by candle) until it successfully locates the necessary data points. This ensures that even if a recent peak isn't clear, the tool will continue searching further back into the history to find valid structural levels.
- Resistance Line Creation: Once the two most relevant fractal peaks are identified, the script automatically draws a horizontal "Ray" line on your chart.
- The line connects the price level of the first discovered peak to the second.
- Because it is set as a "Ray," the line extends indefinitely to the right, providing a clear visual cue of where current price action might encounter significant resistance.
Summary for the Trader:
Essentially, this tool automates the manual task of looking for "ceiling" prices. It filters out minor market noise and highlights specific historical highs that have acted as structural pivots, allowing you to see potential areas where the market might struggle to break through in the future.
//+------------------------------------------------------------------+
//| LineFrakDown.mq4 |
//| Yuriy Tokman |
//| yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link "yuriytokman@gmail.com"
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
ObjectCreate("Rezist", OBJ_TREND, 0,0,0,0,0);//ñîçäàíèå òðåíäîâîé ëèíèè
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
ObjectDelete("Rezist");//óäàëåíèå îáåêòà
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
double F1=0, F3=0, F13; // íîìåðà ôðàêòàëîâ
int B1, B3, SR=2; // íîìåðà áàðîâ
while(F3==0) //ïîèñê ôðàêòàëîâ
{
F13=iFractals(NULL,0,MODE_UPPER,SR);
if (F13!=0)
{
if (F1==0){B1=SR; F1=F13;}
else if (F3==0){B3=SR; F3=F13;}
}
SR++;
}
ObjectSet("Rezist", OBJPROP_TIME1 ,iTime(NULL,0,B3));
ObjectSet("Rezist", OBJPROP_TIME2 ,iTime(NULL,0,B1));
ObjectSet("Rezist", OBJPROP_PRICE1,iHigh(NULL,0,B3));
ObjectSet("Rezist", OBJPROP_PRICE2,iHigh(NULL,0,B1));
ObjectSet("Rezist", OBJPROP_RAY , True);
//----
return(0);
}
//+------------------------------------------------------------------+
Comments