News Alert 21
Download scriptThis tool is designed to act as a real-time monitoring system for traders who need to stay aware of sudden market fluctuations, particularly those caused by significant economic news or periods of high volatility. Instead of analyzing price trends or complex mathematical patterns, this script focuses on the underlying "cost" and "restriction" metrics of your trading environment to provide early warnings.
How it Works
The logic operates by establishing a baseline for two specific market conditions: Spread and Stop Level.
-
Establishing the Norm: When you first load the indicator onto your chart, the script scans the current market data to identify what is considered "normal" for that specific asset. It records the standard cost of entering a trade (the Spread) and the minimum distance required to place a stop-loss order (the Stop Level).
-
Continuous Monitoring: The script then constantly refreshes its view of the live market. Every time the market moves, it compares the live data against those initial "normal" benchmarks.
-
Automated Alerts: If the current market conditions deviate significantly from the norm, the script triggers an immediate alert. It specifically looks for:
- Spread Spikes: If the cost to enter a trade suddenly increases beyond the normal range, it alerts you that high volatility or news-related instability may be occurring.
- Stop Level Changes: If the market becomes so volatile that the platform requires a larger distance to place stop orders, the script notifies you of this change in liquidity or stability.
Summary for the Trader
Essentially, this is a "volatility alarm." It doesn't tell you which way the price will go; rather, it warns you when the market environment becomes "unstable." By notifying you the moment the spread widens or stop levels shift, it helps you avoid entering trades during unpredictable news events where costs might be too high or execution might become unreliable.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| News Alert 2.mq4 |
//| João Barbosa |
//| obarbosa2001@yahoo.com.br |
//+------------------------------------------------------------------+
#property copyright "João Barbosa"
#property link "obarbosa2001@yahoo.com.br"
#property indicator_chart_window
int NormalSpread, NormalStopLevel;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
NormalSpread=MarketInfo(Symbol(),MODE_SPREAD);
NormalStopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
start();
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
RefreshRates();
int ActualSpread=(Ask-Bid)/Point;
int ActualStopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
if (ActualSpread>NormalSpread) { Alert("News or High Volatility !!! Spread has change.");
Print("Actual Spread: ",ActualSpread," Pips, Normal Spread: ",NormalSpread," Pips"); }
if (ActualStopLevel>NormalStopLevel) { Alert("News or High Volatility !!! Stop Level has change.");
Print("Actual Stop Level: ",ActualStopLevel," Pips, Normal Stop Level: ",NormalStopLevel," Pips"); }
return(0);
}
//+------------------------------------------------------------------+
Comments