StatMonitor_1.1-Phat-

Author: Lowphat � 2006
StatMonitor_1.1-Phat-

This script is designed as a real-time data monitoring tool for traders using the MetaTrader platform. Its primary purpose is to aggregate and display essential market statistics—specifically pricing gaps, overnight costs, and trading activity—directly on a separate dedicated dashboard window.

By automating the retrieval of these values, the tool allows traders to keep a constant eye on critical "hidden" costs and market dynamics without having to manually navigate through complex broker settings or menus.

Key Functionalities:

1. Real-Time Spread Tracking The tool monitors the current "Spread," which represents the difference between the buy and sell prices of an asset. It displays this value instantly, helping traders understand the immediate cost of entering a position at any given moment.

2. Buy and Sell Swap Monitoring One of the more advanced features of this script is its ability to track "Swaps." These are the interest rates charged (or paid) by the broker for holding a position open overnight.

  • Buy Swap: Shows the cost/reward for holding a long position.
  • Sell Swap: Shows the cost/reward for holding a short position. The script includes visual logic to help you identify these costs at a glance: it dynamically changes the color of the text to Lime if the value is positive and Red if it is negative, making it easy to spot whether you are accruing costs or earning interest.

3. Volume Analysis The tool captures and displays the current trading volume for the specific asset being viewed. This provides a quick snapshot of market liquidity and activity levels.

User Experience & Visual Design

Instead of cluttered data, the script organizes these four metrics into a clean, linear dashboard at the top of a separate window. It uses distinct labels (e.g., "Current Spread," "Buy Swap," "Sell Swap," and "Volume") paired with their corresponding live values.

The design is intended to be "glanceable," meaning a trader can quickly verify the market conditions and overnight fees in a single look, ensuring they have the most accurate data available for making informed trading decisions.

15 Views
0 Downloads
0 Favorites
StatMonitor_1.1-Phat-
//+------------------------------------------------------------------+
//|                                                     SwapMon      |
//|                                                   Lowphat © 2006 |
//+------------------------------------------------------------------+
#property copyright "Lowphat © 2006"
#property link      "mystikvgv@yahoo.com (mail only)"
#property indicator_separate_window

double    swaplong,swapshort;
int spread,Vol;
int init(){
IndicatorShortName("Stat Monitor ("+Symbol()+")");

return(0);}
int deinit(){return(0);}

int start()
  {
spread=MarketInfo(Symbol(),13);
swaplong=NormalizeDouble(MarketInfo(Symbol(),18),2);
swapshort=NormalizeDouble(MarketInfo(Symbol(),19),2);
Vol=Volume[0];
        ObjectCreate("Stat Monitor1", OBJ_LABEL, WindowFind("Stat Monitor ("+Symbol()+")"), 0, 0);
        ObjectSetText("Stat Monitor1","Current Spread:", 10, "Arial Bold", CadetBlue);
        ObjectSet("Stat Monitor1", OBJPROP_CORNER, 0);
        ObjectSet("Stat Monitor1", OBJPROP_XDISTANCE, 150);
        ObjectSet("Stat Monitor1", OBJPROP_YDISTANCE, 2);
        
        ObjectCreate("Stat Monitor2", OBJ_LABEL, WindowFind("Stat Monitor ("+Symbol()+")"), 0, 0);
        ObjectSetText("Stat Monitor2",DoubleToStr(spread ,0),10, "Arial Bold", Lime);
        ObjectSet("Stat Monitor2", OBJPROP_CORNER, 0);
        ObjectSet("Stat Monitor2", OBJPROP_XDISTANCE, 260);
        ObjectSet("Stat Monitor2", OBJPROP_YDISTANCE, 2);
        
        ObjectCreate("Stat Monitor3", OBJ_LABEL, WindowFind("Stat Monitor ("+Symbol()+")"), 0, 0);
        ObjectSetText("Stat Monitor3","Buy Swap:", 10, "Arial Bold", CadetBlue);
        ObjectSet("Stat Monitor3", OBJPROP_CORNER, 0);
        ObjectSet("Stat Monitor3", OBJPROP_XDISTANCE, 350);
        ObjectSet("Stat Monitor3", OBJPROP_YDISTANCE, 2);
        
        ObjectCreate("Stat Monitor4", OBJ_LABEL, WindowFind("Stat Monitor ("+Symbol()+")"), 0, 0);
        if (swaplong>0)
        {
        ObjectSetText("Stat Monitor4",DoubleToStr( swaplong ,2),10, "Arial Bold", Lime);
        }
        else ObjectSetText("Stat Monitor4",DoubleToStr( swaplong ,2),10, "Arial Bold", Red);
        ObjectSet("Stat Monitor4", OBJPROP_CORNER, 0);
        ObjectSet("Stat Monitor4", OBJPROP_XDISTANCE, 430);
        ObjectSet("Stat Monitor4", OBJPROP_YDISTANCE, 2);
        
        ObjectCreate("Stat Monitor5", OBJ_LABEL, WindowFind("Stat Monitor ("+Symbol()+")"), 0, 0);
        ObjectSetText("Stat Monitor5","Sell Swap:", 10, "Arial Bold", CadetBlue);
        ObjectSet("Stat Monitor5", OBJPROP_CORNER, 0);
        ObjectSet("Stat Monitor5", OBJPROP_XDISTANCE, 530);
        ObjectSet("Stat Monitor5", OBJPROP_YDISTANCE, 2);
        
        ObjectCreate("Stat Monitor6", OBJ_LABEL, WindowFind("Stat Monitor ("+Symbol()+")"), 0, 0);
        if (swapshort>0)
        {
        ObjectSetText("Stat Monitor6",DoubleToStr( swapshort ,2),10, "Arial Bold", Lime);
        }
        else ObjectSetText("Stat Monitor6",DoubleToStr( swapshort ,2),10, "Arial Bold", Red);
        ObjectSet("Stat Monitor6", OBJPROP_CORNER, 0);
        ObjectSet("Stat Monitor6", OBJPROP_XDISTANCE, 610);
        ObjectSet("Stat Monitor6", OBJPROP_YDISTANCE, 2);
        
        ObjectCreate("Stat Monitor7", OBJ_LABEL, WindowFind("Stat Monitor ("+Symbol()+")"), 0, 0);
        ObjectSetText("Stat Monitor7","Volume:", 10, "Arial Bold", CadetBlue);
        ObjectSet("Stat Monitor7", OBJPROP_CORNER, 0);
        ObjectSet("Stat Monitor7", OBJPROP_XDISTANCE, 700);
        ObjectSet("Stat Monitor7", OBJPROP_YDISTANCE, 2);
        
        ObjectCreate("Stat Monitor8", OBJ_LABEL, WindowFind("Stat Monitor ("+Symbol()+")"), 0, 0);
        ObjectSetText("Stat Monitor8",DoubleToStr(Vol ,0),10, "Arial Bold", Lime);
        ObjectSet("Stat Monitor8", OBJPROP_CORNER, 0);
        ObjectSet("Stat Monitor8", OBJPROP_XDISTANCE, 760);
        ObjectSet("Stat Monitor8", OBJPROP_YDISTANCE, 2);

   return(0);
  }

Comments