XaosExplore_PerkyMod
Download scriptThe XAOS PATTERNS EXPLORER is a specialized technical analysis tool designed to identify specific price movements and potential entry points by comparing historical price data over a set timeframe. Instead of relying on standard momentum or volume oscillators, this script focuses on the mathematical relationship between the current price and its past performance.
Core Logic and Mechanics
The script operates based on three primary pillars: Time Offset, Relative Ratio Analysis, and Threshold Detection.
1. Time Displacement (The "Separation" Factor) The tool does not look at immediate, tick-by-tick changes. Instead, it utilizes a "Separation" variable. This allows the script to compare the current market price against a specific point in the past (for example, comparing today's price to where the price was 15 bars ago). This helps smooth out "market noise" and focuses on broader structural moves.
2. Relative Ratio Calculations To determine if a significant move has occurred, the script calculates ratios across four different data points:
- Closing Prices
- Specific Upper Reference Levels (Indicator Level 1)
- Specific Lower Reference Levels (Indicator Level 2)
- Lowest Lows over the specified period
By calculating these ratios, the tool determines how much the price has deviated or "stretched" relative to its previous position.
3. Signal Identification The script constantly scans these ratios against two pre-defined thresholds:
- Buy Signals: If the calculated ratio exceeds the upper threshold (Indicator Level 1), the script identifies a breakout or strength in the upward direction. It then places a visual marker on the chart and triggers a notification.
- Sell Signals: Conversely, if the ratio falls below the lower threshold (Indicator Level 2), it suggests a downward trend or weakness, triggering a corresponding visual sell marker and alert.
User Experience Features
- Visual Feedback: The script provides clear visual cues on the trading chart using distinct arrows to highlight exactly where the logic identifies a potential trend shift.
- Customizable Sensitivity: Users can adjust the "Level" constants to make the tool more sensitive (catching smaller moves) or more conservative (only identifying major price breaks).
- Real-Time Alerts: When configured, the script can send active notifications (pop-ups) to the user's platform the moment a signal is triggered, ensuring that traders do not have to watch the charts constantly to catch a move.
//+------------------------------------------------------------------+
//| XAOS PATTERNS EXPLORER |
//| bY Edward Samokhvalov |
//| (c) 9.4.2007 |
//+------------------------------------------------------------------+
#property copyright "Edward Samokhvalov"
#property indicator_separate_window
#property indicator_buffers 6
//----
#property indicator_color1 LightBlue
#property indicator_color2 White
#property indicator_color3 White
#property indicator_color4 Black
#property indicator_color5 Tomato
#property indicator_color6 LimeGreen
//#property indicator_level1 1.0010 // I believe playing around with these constants
//#property indicator_level2 0.999 // can make patterns appear more vivid as well as unvivid.
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
extern int Separation=15;
extern int AlarmOn=false;
extern int SHOW_SIGNALS=true;
extern double indicator_lev1 =1.0023; // I believe playing around with these constants
extern double indicator_lev2= 0.9979; // can make patterns appear more vivid as well as unvivid.
//----
double buff2[];
double buff3[];
double buff4[];
double buff1[];
double buy[];
double sell[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);
SetIndexBuffer(0,buff1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,buff2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,buff3);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,buff4);
//----
SetIndexStyle(4,DRAW_ARROW,0,1);
SetIndexBuffer(4,buy);
SetIndexArrow(4,119);
//----
SetIndexStyle(5,DRAW_ARROW,0,1);
SetIndexBuffer(5,sell);
SetIndexArrow(5,119);
IndicatorShortName(" "+Separation+" ");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if(Bars<=Separation) return(0);
int pos=0;
int barsToCount=Bars - counted_bars;
//---- initial zero
if(counted_bars<1)
for(int i=1;i<=Separation;i++)
{
buff1[Bars-i]=0.0;
buff2[Bars-i]=0.0;
buff3[Bars-i]=0.0;
buff4[Bars-i]=0.0;
buy[Bars-i]=0.0;
sell[Bars-i]=0.0;
}
//----
pos=Bars-Separation-1;
if(counted_bars>=Separation) pos=Bars-counted_bars-1;
while(pos>=0)
{
buff1[pos]=Close[pos+Separation]/Close[pos];
buff2[pos]=indicator_lev1;//Open[pos+Separation]/Open[pos];
buff3[pos]=indicator_lev2;//High[pos+Separation]/High[pos];
buff4[pos]=Low[pos+Separation]/Low[pos];
if (SHOW_SIGNALS==true)
{
// SELL SIGNAL
if (buff1[pos] > indicator_lev1)
{
buy[pos]=buff1[pos];
sig("["+TimeToStr(CurTime())+"] " + Symbol() + ": BUY!)",pos);
}
else if (buff2[pos] > indicator_lev1)
{
buy[pos]=buff2[pos];
sig("["+TimeToStr(CurTime())+"] " + Symbol() + ": BUY!)",pos);
}
else if(buff3[pos] > indicator_lev1)
{
buy[pos]= buff3[pos];
sig("["+TimeToStr(CurTime())+"] " + Symbol() + ": BUY!)",pos);
}
else if (buff4[pos] > indicator_lev1)
{
buy[pos]=buff4[pos];
sig("["+TimeToStr(CurTime())+"] " + Symbol() + ": BUY!)",pos);
}
// BUY SIGNAL
else if (buff1[pos] < indicator_lev2)
{
sell[pos]=buff1[pos];
sig("["+TimeToStr(CurTime())+"] " + Symbol() + ": SELL!)",pos);
}
else if (buff2[pos] < indicator_lev2)
{
sell[pos]=buff2[pos];
sig("["+TimeToStr(CurTime())+"] " + Symbol() + ": SELL!)",pos);
}
else if(buff3[pos] < indicator_lev2)
{
sell[pos]= buff3[pos];
sig("["+TimeToStr(CurTime())+"] " + Symbol() + ": SELL!)",pos);
}
else if (buff4[pos] < indicator_lev2)
{
sell[pos]=buff4[pos];
sig("["+TimeToStr(CurTime())+"] " + Symbol() + ": SELL!)",pos);
}
}
pos--;
}
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void sig(string msg, int p)
{
if (AlarmOn==true && TimeToStr(Time[p])==TimeToStr(CurTime()))Alert(msg);
}
//+------------------------------------------------------------------+
Comments