SpreadMonitor-Phat-

Download script
Author: Lowphat � 2006
SpreadMonitor-Phat-

The Spread Monitor is a specialized tracking tool designed for traders to keep a real-time eye on market liquidity and pricing costs. In trading, the "spread" represents the difference between the highest price at which you can sell an asset and the lowest price at which you can buy it; this tool ensures you are always aware of these fluctuations as they happen.

Core Functionality

The script continuously monitors the live market feed to calculate the current spread in points. It provides a clear, side-by-side comparison between the current market conditions and the previous data point, allowing for an immediate visual assessment of market volatility or liquidity shifts.

Key Features:

  • Real-Time Monitoring: The tool automatically calculates the spread for the specific financial instrument you are viewing, updating the information instantly as price action occurs.
  • Historical Comparison: It records and displays the "Previous Spread" alongside the "Current Spread." This helps traders quickly identify if the market is widening (indicating lower liquidity or higher volatility) or narrowing (indicating a more stable trading environment).
  • Dynamic Visual Display: The script generates a dedicated information dashboard on your chart. This includes clearly labeled text fields for:
    • Current Spread value
    • Previous Spread value
    • Status of the alert system
  • Customizable Alerts: Users can enable an automated notification system. If the spread changes significantly between price ticks, the tool can trigger a pop-up alert. This is particularly useful for traders who need to be notified of sudden market "shocks" or spikes in trading costs without having to watch the screen constantly.

How it Benefits the Trader

By providing a dedicated visual window for spread data, this script removes the guesswork from analyzing liquidity. Instead of manually calculating differences, a trader can glance at the monitor to ensure that trading costs remain within an acceptable range before executing a position. It serves as an essential "early warning system" for high-volatility periods where spreads might widen unexpectedly.

13 Views
0 Downloads
0 Favorites
SpreadMonitor-Phat-
//+------------------------------------------------------------------+
//|                                                  SpreadMoniter   |
//|                                                   Lowphat © 2006 |
//|                                        Format hijacked from cja  |
//+------------------------------------------------------------------+
#property copyright "Lowphat © 2006"
#property link      ""
#property indicator_separate_window
extern bool AlertOn=false;
bool firststart;
int SpreadPrev,Spread, Spreadhold;
int nDigits;
int init(){IndicatorShortName("Spread Monitor");firststart=true;return(0);}
int deinit(){return(0);}

int start()
  {
 
if (firststart==false){if (Spread!=NormalizeDouble((Ask-Bid)/Point,0)) {SpreadPrev=Spread;if (AlertOn) Alert ("Spread Change on ",Symbol())   ;  //PlaySound("alert2.wav"); 
}
Spread=NormalizeDouble((Ask-Bid)/Point,0); }
if (firststart==true){SpreadPrev=NormalizeDouble((Ask-Bid)/Point,0);Spread=NormalizeDouble((Ask-Bid)/Point,0);firststart=false;} 
string alrt;
if (AlertOn)alrt="On";else alrt="Off";
        ObjectCreate("Spread Monitor1", OBJ_LABEL, WindowFind("Spread Monitor"), 0, 0);
        ObjectSetText("Spread Monitor1","Current Spread:", 10, "Arial Bold", CadetBlue);
        ObjectSet("Spread Monitor1", OBJPROP_CORNER, 0);
        ObjectSet("Spread Monitor1", OBJPROP_XDISTANCE, 150);
        ObjectSet("Spread Monitor1", OBJPROP_YDISTANCE, 2);
        ObjectCreate("Spread Monitor2", OBJ_LABEL, WindowFind("Spread Monitor"), 0, 0);
        ObjectSetText("Spread Monitor2",DoubleToStr(Spread ,0),10, "Arial Bold", Lime);
        ObjectSet("Spread Monitor2", OBJPROP_CORNER, 0);
        ObjectSet("Spread Monitor2", OBJPROP_XDISTANCE, 260);
        ObjectSet("Spread Monitor2", OBJPROP_YDISTANCE, 2);
        ObjectCreate("Spread Monitor3", OBJ_LABEL, WindowFind("Spread Monitor"), 0, 0);
        ObjectSetText("Spread Monitor3","Previous Spread:", 10, "Arial Bold", CadetBlue);
        ObjectSet("Spread Monitor3", OBJPROP_CORNER, 0);
        ObjectSet("Spread Monitor3", OBJPROP_XDISTANCE, 350);
        ObjectSet("Spread Monitor3", OBJPROP_YDISTANCE, 2);
        ObjectCreate("Spread Monitor4", OBJ_LABEL, WindowFind("Spread Monitor"), 0, 0);
        ObjectSetText("Spread Monitor4",DoubleToStr( SpreadPrev ,0),10, "Arial Bold", Lime);
        ObjectSet("Spread Monitor4", OBJPROP_CORNER, 0);
        ObjectSet("Spread Monitor4", OBJPROP_XDISTANCE, 470);
        ObjectSet("Spread Monitor4", OBJPROP_YDISTANCE, 2);
        ObjectCreate("Spread Monitor5", OBJ_LABEL, WindowFind("Spread Monitor"), 0, 0);
        ObjectSetText("Spread Monitor5","Alert:", 10, "Arial Bold", CadetBlue);
        ObjectSet("Spread Monitor5", OBJPROP_CORNER, 0);
        ObjectSet("Spread Monitor5", OBJPROP_XDISTANCE, 560);
        ObjectSet("Spread Monitor5", OBJPROP_YDISTANCE, 2);
        ObjectCreate("Spread Monitor6", OBJ_LABEL, WindowFind("Spread Monitor"), 0, 0);
        ObjectSetText("Spread Monitor6",alrt,10, "Arial Bold", Lime);
        ObjectSet("Spread Monitor6", OBJPROP_CORNER, 0);
        ObjectSet("Spread Monitor6", OBJPROP_XDISTANCE, 600);
        ObjectSet("Spread Monitor6", OBJPROP_YDISTANCE, 2);
        

   return(0);
  }

Comments