ATM_TLineAudioRisingAlert
Download scriptThis script is designed as a visual and audible monitoring tool for traders using the MetaTrader platform. Its primary purpose is to provide real-time notifications whenever the current market price interacts with a specific trend line drawn on your chart.
Core Functionality
The tool automates the process of "watching" a specific price level. Instead of requiring you to stare at the screen constantly to see if the price hits a target, the script identifies that interaction for you and triggers an immediate notification.
How it Works
- Visual Reference: The script automatically places a trend line on your chart. This line is configured based on user preferences regarding its color, thickness, and style (e.g., solid or dashed), making it easy to identify on your workspace.
- Price Monitoring: It continuously calculates the current "Bid" price (the price at which you can sell) in relation to the position of this trend line.
- Proximity Detection: The script is programmed with a specific "alert range." When the market price moves within this designated distance of the trend line, the system recognizes it as a significant event.
- Notification System: Once the price enters that designated range, the script triggers two types of alerts based on your settings:
- Audio Alert: It plays a specific sound file to grab your attention instantly.
- Email Notification: If enabled, it automatically sends an email alert to your connected account, ensuring you are notified even if you are away from your computer.
Summary of Benefits
By using this logic, traders can set up "set and forget" alerts on key trend lines. It bridges the gap between manual chart observation and automated monitoring, providing a reliable way to stay informed about price action transitions without the need to constantly monitor every tick of the market.
//+------------------------------------------------------------------+
//| HLine Alert.mq4 |
//+------------------------------------------------------------------+
#property copyright "raff1410@o2.pl"
#property indicator_chart_window
extern string TLineName="TrendLineRisingAlert";
extern color LineColor=Blue;
extern int LineStyle=STYLE_SOLID;
extern int LineWidth=2;
extern int AlertPipRange=2;
extern string AlertWav="alert.wav";//rising-price-alert.wav";
extern bool EmailON=false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
ObjectCreate(TLineName, OBJ_TREND, 0, Time[25], Bid, Time[0], Ask);
ObjectSet(TLineName, OBJPROP_STYLE, LineStyle);
ObjectSet(TLineName, OBJPROP_COLOR, LineColor);
ObjectSet(TLineName, OBJPROP_WIDTH, LineWidth);
double val=ObjectGetValueByShift(TLineName, 0);
if (Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val) PlaySound(AlertWav);
if (EmailON) SendMail("FX Currency Rising Price Alert","FX Currency Rising Price Alert");
//----
//----
return(0);
}
//+------------------------------------------------------------------+
Comments