Spread Alert

Download script
Author: Jo�o Barbosa
Spread Alert

This tool is designed to act as a real-time monitoring system for your trading platform, specifically focusing on two critical market conditions: the Spread and the Stop Level. Its primary purpose is to notify you immediately whenever these values fluctuate away from their expected norms.

How it Works

The script functions by establishing a "baseline" as soon as you load it onto your chart. It looks at the current market conditions for your selected currency pair and remembers what the standard spread (the difference between the buy and sell price) and stop level are at that moment.

As the market continues to move, the tool constantly scans the live data. It compares the live prices against those saved baseline values.

Key Features

  • Spread Monitoring: The script calculates the current spread in real-time. If the gap between the "Ask" and "Bid" prices changes from your initial starting point, the tool triggers an instant alert on your screen. This helps you stay aware of sudden market volatility or liquidity issues that could make trading more expensive.
  • Stop Level Tracking: It also monitors the "Stop Level," which is the minimum distance required by a broker to place pending orders. If your broker changes this limit dynamically, the script will alert you so you are aware of any new restrictions on where you can place your trades.
  • Automated Notifications: Instead of you having to watch the numbers constantly, the script handles the "watching" for you. It only speaks up when a change is detected, providing you with a clear message that shows both the new value and the original normal value for easy comparison.

Purpose for the Trader

This tool is built for traders who want to avoid being caught off guard by sudden spikes in transaction costs or changes in broker rules. By providing instant alerts on these hidden mechanics of the market, it ensures you have a clearer picture of the environment in which you are trading.

Miscellaneous
It issuies visual alerts to the screen
13 Views
0 Downloads
0 Favorites
Spread Alert
//+------------------------------------------------------------------+
//|                                                 Spread Alert.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,LastSpread,LastStopLevel;

int init()
  {
   NormalSpread=MarketInfo(Symbol(),MODE_SPREAD);
   NormalStopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
   LastSpread=NormalSpread;LastStopLevel=NormalStopLevel;
   return(0);
  }

int start()
  { 
   RefreshRates();Sleep(500);
   int ActualSpread=MathMax((Ask-Bid)/Point,NormalSpread);
   int ActualStopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
   if (ActualSpread!=LastSpread) {
     Alert(Symbol()," - Spread has change to ",ActualSpread," pips. Normal is ",NormalSpread," pips.");Sleep(500);
     LastSpread=ActualSpread; }
   if (ActualStopLevel!=NormalStopLevel) {
     Alert(Symbol()," - Stop Level has change to ",ActualStopLevel," pips. Normal is ",NormalStopLevel," pips.");Sleep(500);
     LastSpread=ActualSpread; }
   return(0);
  }

Comments