120224_1420_T-foREX_Photos_v02_Orders
Download scriptThis tool is designed to automatically capture and archive visual snapshots of your trading activity based on specific changes in your order history. It acts as an automated "camera" for your trading platform, ensuring that you have a clear record of your positions at key moments.
How the System Works
Automated Activity Monitoring The script constantly monitors your current trading account to track the number of open orders for the specific currency pair or asset you are currently viewing. It is designed to recognize any change—whether you are opening a new position, closing an existing one, or modifying your trades.
Smart Snapshot Triggering Unlike manual tools, this script only triggers a "photo" when it detects a difference in your order count. This means it won't clutter your files with unnecessary images; it only captures a snapshot at the exact moment your portfolio changes.
Organized File Management Every time a change is detected, the script automatically generates a unique filename for the screenshot. These filenames are intelligently constructed to include:
- The name of the specific asset (e.g., EURUSD).
- The precise date and time of the activity.
- The timeframe currently active on your chart.
Visual Feedback and Logging To keep you informed, the tool provides real-time status updates directly on your trading screen. It includes a dedicated text display that shows a timestamp and confirms whether the snapshot was successfully saved or if an error occurred. Additionally, it features a "flashing" notification system to grab your attention for important alerts.
Key Benefits
- Hands-Free Archiving: Automatically creates a visual history of your trading journey without requiring manual screenshots.
- Precise Documentation: Provides a chronological record of how your positions evolved over time.
- Clean Organization: Saves files with clear, descriptive names so you can easily find specific trades later for review or analysis.
//+------------------------------------------------------------------+
//| 120224 1420 T-foREX Photos v02 Orders.mq4 |
//| T-foREX |
//| http://jobaweb.net |
//+------------------------------------------------------------------+
#property copyright "T-foREX"
#property link "http://jobaweb.net"
datetime firstTime = 0;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
string www = "http://jobaweb.net";
if (ObjectFind(www) != 0)
{
ObjectCreate(www, OBJ_LABEL, 0, 0, 0);
ObjectSet(www, OBJPROP_BACK, true);
ObjectSet(www, OBJPROP_CORNER, 3);
ObjectSet(www, OBJPROP_XDISTANCE, 5);
ObjectSet(www, OBJPROP_YDISTANCE, 250);
ObjectSet(www, OBJPROP_ANGLE, 90);
ObjectSetText(www, www, 10, "Tahoma", Lime);
}
if (firstTime == 0)
{
firstTime = TimeLocal();
print("T-foREX starts @ " + TimeToStr(TimeCurrent()), true);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
takePic();
}
int nOld = 0;
int takePic()
{
//----
int pos, nOrd = 0;
for (pos = 0; pos < OrdersTotal(); pos++) if (OrderSelect(pos, SELECT_BY_POS) && OrderSymbol() == Symbol()) nOrd += 1;
if (nOrd != nOld)
{
nOld = nOrd;
string photoTime = TimeToStr(TimeLocal());
string photoName = Symbol() + " " +
StringSubstr(photoTime, 0, 4) + StringSubstr(photoTime, 5, 2) + StringSubstr(photoTime, 8, 2) + " " +
StringSubstr(photoTime, 11, 2) + StringSubstr(photoTime, 14, 2) +
" M" + Period();
print (photoName);
if (WindowScreenShot(photoName + ".gif", 800, 600)) print(photoName + " OK!", true);
else print(photoName + " ERROR " + GetLastError(), true);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| general management |
//+------------------------------------------------------------------+
int print(string text, bool flashing = false)
{
if (ObjectFind( "Check text") < 0)
{
ObjectCreate("Check text", OBJ_LABEL, 0, 0, 0);
ObjectSet( "Check text", OBJPROP_COLOR, White);
ObjectSet( "Check text", OBJPROP_BACK, false);
ObjectSet( "Check text", OBJPROP_CORNER, 0);
ObjectSet( "Check text", OBJPROP_XDISTANCE, 250);
ObjectSet( "Check text", OBJPROP_YDISTANCE, 20);
}
ObjectSetText( "Check text", TimeToStr(TimeLocal(), TIME_SECONDS) + " " + text, 10, "Tahoma");
if (flashing && ObjectGet("Check text", OBJPROP_COLOR) == White) ObjectSet("Check text", OBJPROP_COLOR, Red);
else if (flashing && ObjectGet("Check text", OBJPROP_COLOR) == Red) ObjectSet("Check text", OBJPROP_COLOR, White);
else ObjectSet("Check text", OBJPROP_COLOR, White);
return(0);
}
//+------------------------------------------------------------------+
Comments