Gramski Alert EA
Download scriptThis automated script is designed to monitor live financial markets and provide real-time notifications when specific price action conditions are met. It works by analyzing two distinct technical indicators to confirm "Buy" (Bullish) and "Sell" (Bearish) opportunities, ensuring that a signal is only triggered when both indicators align simultaneously.
Core Logic Overview
The script functions as a dual-confirmation system. It evaluates the relationship between momentum and trend strength to filter out market noise and identify potential entry points.
1. Momentum Analysis (Laguerre RSI) The first layer of logic uses a specialized Relative Strength Index (RSI) called the Laguerre RSI. This indicator measures the speed and change of price movements. The script specifically looks for "crosses" at predefined thresholds:
- For Bullish signals: It monitors when the momentum moves upward across a lower boundary (Level 1).
- For Bearish signals: It monitors when the momentum moves downward across a higher boundary (Level 2).
2. Trend Strength Confirmation (Absolute Strength Hist) To prevent false signals, the script cross-references the momentum data with a second indicator called "Absolute Strength Hist." This tool measures the underlying strength of the current trend. The script only triggers an alert if this secondary indicator confirms that there is active strength in the direction of the price move.
Signal Execution
When both conditions—the specific Laguerre RSI crossover and the required Absolute Strength confirmation—occur at the same time, the script performs three actions:
- Visual Marking: It places a colored object (an arrow or icon) directly on the price chart to highlight exactly where the signal occurred. Blue marks indicate Bullish signals, while Red marks indicate Bearish signals.
- Audio Alert: It plays a notification sound to grab the trader's attention immediately.
- Pop-up Notification: It generates an on-screen alert window stating whether a Bull or Bear signal has been detected along with the specific level triggered.
Smart Filtering
The logic includes a "state management" feature. This ensures that the script does not send multiple repetitive alerts for the same ongoing move. Once a signal is identified, it stays "locked" until the market dynamics shift (indicated by a change in the strength indicators), at which point the system resets and becomes ready to identify the next unique trade setup.
//+------------------------------------------------------------------+
//| alert_gramski.mq4 |
//+------------------------------------------------------------------+
extern double Laguerre_parameter=0.7;
extern double Laguerre_level1=0.15;
extern double Laguerre_level2=0.75;
//parameters from AbsolteStrenghtHist0o_v1
extern int Mode = 0; // 0-RSI method; 1-Stoch method
extern int Length = 9; // Period
extern int Smooth = 1; // Period of smoothing
extern int Signal = 4; // Period of Signal Line
extern int Price = 0; // Price mode : 0-Close,1-Open,2-High,3-Low,4-Median,5-Typical,6-Weighted
extern int ModeMA = 3; // Mode of Moving Average
extern int Mode_Histo = 3;
int ob=0;
bool bull1=false;
bool bear2=false;
int init(){return(0);}
int deinit(){return(0);}
int start()
{
double l1=iCustom(Symbol(),0,"Laguerre RSI",Laguerre_parameter,0,1);
double l0=iCustom(Symbol(),0,"Laguerre RSI",Laguerre_parameter,0,0);
double a_blue=iCustom(Symbol(),0,"AbsoluteStrenghtHisto_v1",Mode,Length,Smooth,Signal,Price,ModeMA,Mode_Histo,0,0);
double a_red=iCustom(Symbol(),0,"AbsoluteStrenghtHisto_v1",Mode,Length,Smooth,Signal,Price,ModeMA,Mode_Histo,1,0);
//bull signals
if (l1<Laguerre_level1 && l0>=Laguerre_level1 && a_blue>0 && !bull1){
bull1=true;
ObjectCreate("obj"+ob,22,0,Time[0],Open[0]);
ObjectSet("obj"+ob,6,Blue);
ob++;
PlaySound("Alert.wav");
Alert("Bull signal at Laguerre:"+Laguerre_level1);
}
//bear signals
if (l1>Laguerre_level2 && l0<=Laguerre_level2 && a_red>0 && !bear2){
bear2=true;
ObjectCreate("obj"+ob,22,0,Time[0],Open[0]);
ObjectSet("obj"+ob,6,Red);
ObjectSet("obj"+ob,14,242);
ob++;
PlaySound("Alert.wav");
Alert("Bear signal at Laguerre:"+Laguerre_level2);
}
if (a_red>0) {bull1=false;}
if (a_blue>0) {bear2=false;}
return(0);
}
Comments