News Alert 21_v1

Download script
Author: Jo�o Barbosa
News Alert 21_v1

This tool is designed to act as an automated early warning system for traders, specifically highlighting moments of extreme market instability or significant economic news events. It monitors the "heartbeat" of the market—specifically the costs and restrictions associated with trading—to alert you when conditions become unfavorable.

How it Works

When you first load this tool onto your trading platform, it takes a "snapshot" of the current market environment. It identifies two key baseline values:

  1. The Normal Spread: This is the standard difference between the buy and sell prices in the current market.
  2. The Normal Stop Level: This is the standard minimum distance required by the broker to place pending orders.

Once these baselines are established, the script continuously monitors the live market data in real-time. It looks for any sudden "spikes" in these two metrics.

The Alert System

The logic functions as a safety trigger. If the current market conditions deviate significantly from the baseline captured at startup, the tool will immediately notify you via an on-screen alert and a log entry. It triggers in two specific scenarios:

  • Volatility/Spread Alerts: If the cost of entering a trade (the spread) suddenly widens beyond its normal range, the tool alerts you that there is likely high volatility or significant news breaking.
  • Stop Level Alerts: If the broker increases the minimum distance required for your "stop" orders, the tool flags this as a change in market behavior, which often happens during heavy news events when price movement becomes unpredictable.

Key Benefits for Traders

Instead of you having to manually watch every price tick or constantly check news calendars, this script provides an automated "heads up." It serves as a defensive layer, notifying you the moment the market environment shifts from "normal" to "volatile," allowing you to make informed decisions about whether to stay in a trade or wait for the dust to settle.

Miscellaneous
It issuies visual alerts to the screen
7 Views
0 Downloads
0 Favorites
News Alert 21_v1
//+------------------------------------------------------------------+
//|                                                 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