This indicator is designed to identify specific price action patterns known as "Hikkake" on your trading charts. Its primary goal is to detect moments where the market might be attempting a fake-out or a sudden shift in momentum, providing visual signals and alerts to help traders anticipate potential reversals.
How the Logic Works
The script constantly monitors the relationship between three consecutive price candles (the current candle, the previous one, and the one before that) based on a timeframe you select. It looks for very specific geometric arrangements in the "High," "Low," and "Close" prices of these candles to trigger its signals.
Signal Detection
The tool identifies two main types of movements:
1. Standard Momentum Shifts
- Sell Signals: The script looks for a situation where a previous candle was completely contained within the boundaries of an even earlier candle (an inside bar). If the current candle then breaks out significantly higher than that middle candle, it flags a potential selling opportunity.
- Buy Signals: Conversely, if a previous candle was contained within an earlier one, and the current candle breaks out significantly lower, it flags a potential buying opportunity.
2. Reversal Detection (Refined Logic) The indicator also includes more specific "Reversal" logic that looks for higher precision:
- Reversal Buy: It triggers if the current candle is lower than the previous one, but specifically checks if the previous candle closed at its absolute lowest point and was smaller in size than the candle before it.
- Reversal Sell: It triggers if the current candle is higher than the previous one, specifically checking if the previous candle closed at its absolute highest point and was smaller in size than the candle before it.
Visual and Audio Feedback
When the script identifies these patterns, it performs three actions simultaneously to ensure you don't miss the move:
- On-Chart Markers: It places a visual dot on your chart—YellowGreen for Buy signals and Red for Sell signals—marking the exact price point where the pattern was confirmed.
- Real-Time Alerts: The system generates an instant pop-up alert on your trading terminal, notifying you of the specific "Buy," "Sell," or "Reversal" signal for that currency pair and timeframe.
- Automated Tracking: The script keeps a running count of these signals to ensure it doesn't repeat the same alert unnecessarily, keeping your workspace clean and organized.
//Hikkake Pattern Indicator
#property copyright "Copyright © 2007, modulatum."
#property indicator_chart_window
int buy = 0, sell = 0, i = 0;
extern int minutes;
int init()
{
return(0);
}
int deinit(){
ObjectsDeleteAll(0,0);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double bar0H = iHigh(NULL,minutes,2);
double bar1H = iHigh(NULL,minutes,1);
double bar2H = iHigh(NULL,minutes,0);
double bar0L = iLow(NULL,minutes,2);
double bar1L = iLow(NULL,minutes,1);
double bar2L = iLow(NULL,minutes,0);
double bar0C = iClose(NULL,minutes,2);
double bar1C = iClose(NULL,minutes,1);
double bar2C = iClose(NULL,minutes,0);
double bar1R = MathAbs(bar1H - bar1L);
double bar0R = MathAbs(bar0H - bar0L);
if(bar1L >= bar0L && bar1H <= bar0H){
if(bar2H > bar1H && bar2L > bar1L && sell == 0){
sell = 1;
buy = 0;
i = i + 1;
ObjectCreate("H Sell " + minutes + " " +i,0,0,TimeCurrent(),Close[0]);
ObjectSet("H Sell" + minutes + " " +i,OBJPROP_COLOR,Red);
ObjectSet("H Sell" + minutes + " " +i,OBJPROP_WIDTH,1);
ObjectSet("H Sell" + minutes + " " +i,OBJPROP_STYLE,STYLE_SOLID);
Alert("Sell " + Symbol() + " ("+minutes+") (Hikkake)");
//bear;
}
if(bar2H < bar1H && bar2L < bar1L && buy == 0){
sell = 0;
buy = 1;
i = i + 1;
ObjectCreate("H Buy" + minutes + " " +i,0,0,TimeCurrent(),Close[0]);
ObjectSet("H Buy" + minutes + " " +i,OBJPROP_COLOR,YellowGreen);
ObjectSet("H Buy" + minutes + " " +i,OBJPROP_WIDTH,1);
ObjectSet("H Buy" + minutes + " " +i,OBJPROP_STYLE,STYLE_SOLID);
Alert("Buy " + Symbol() + " ("+minutes+") (Hikkake)");
//bull;
}
if(bar2H < bar1H && bar2L < bar1L && buy == 0 && bar1C == bar1L && bar1R < bar0R){
sell = 0;
buy = 1;
i = i + 1;
ObjectCreate("H Buy" + minutes + " " +i,0,0,TimeCurrent(),Close[0]);
ObjectSet("H Buy" + minutes + " " +i,OBJPROP_COLOR,YellowGreen);
ObjectSet("H Buy" + minutes + " " +i,OBJPROP_WIDTH,1);
ObjectSet("H Buy" + minutes + " " +i,OBJPROP_STYLE,STYLE_SOLID);
Alert("Reversal Buy " + Symbol() + " ("+minutes+") (Hikkake)");
//bull;
}
if(bar2H > bar1H && bar2L > bar1L && sell == 0 && bar1C == bar1H && bar1R < bar0R){
sell = 1;
buy = 0;
i = i + 1;
ObjectCreate("H Sell " + minutes + " " +i,0,0,TimeCurrent(),Close[0]);
ObjectSet("H Sell" + minutes + " " +i,OBJPROP_COLOR,Red);
ObjectSet("H Sell" + minutes + " " +i,OBJPROP_WIDTH,1);
ObjectSet("H Sell" + minutes + " " +i,OBJPROP_STYLE,STYLE_SOLID);
Alert("Reversal Sell " + Symbol() + " ("+minutes+") (Hikkake)");
//bear;
}
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
Comments