Attachments forums

List of attachments posted on this forum.


All files on forums: 154284

💹 Modern Currency Symbol Watermark for MT4 charts

moey_dw, Sat Apr 13, 2024 6:30 pm

Project: Modern Currency Symbol Watermark for MT4 charts

Thread contents
  • New Currency Symbol Watermark with auto centering text version by Mrtools
    15 April 2024 here.
  • New Currency Symbol Watermark with auto centering text + manually adjustable color "blend gradient" by Mrtools
    15 April 2024 here.
  • Timeframe Watermark with auto centering text by Stond:
    20 April 2024 here.
Hi coders and traders,

I'd like to make a request for a modern version of an overlooked tool!
If you have time this weekend could you code a simple market watermark indicator with a few options?

Options:
  • Can automatically center the text!
  • Has basic font choices such as: Arial, Verdana, Times New Roman?
  • Font size please
  • Can be in all caps or lower font
Out of all the Watermark indicators I have used for MT4 I have found that Yancy FX Symbol Watermark is the best one but it's now old and totally lacks the ability to Auto Center the watermark which kills it.

Perhaps it could be a more simple and lightweight version based off the YFX Symbol Watermark?

I think a lot of traders would appreciate this project especially for multiple screens as it would give us the ability to watch over our pairs from afar.......

Is it time for a modern version by Forex Station?


To start this request, here is the cleanest most basic MQL4 code for a Currency Symbol Watermark:

Code: Select all

//+------------------------------------------------------------------+
//|                                                       Symbol.mq4 |
//|                        Copyright 2017, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property description "Draws label of chart symbol and period"
#property strict
#property indicator_chart_window

input color  Text_Color=LightGray; // Text Color
input int    Text_Size=40; // Text Size
input string Text_Font="Verdana"; // Text Type
input int    Corner_=0; // Corner
input int    Left_Right=240; // Left - Right
input int    Up_Down=1; // Up - Dowm

string periodx;
string TF;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {

   int Minx=Period();
   string Miny = "M";
   string Minz = IntegerToString(Period());

   if(Period()<60)
     {
      TF=StringConcatenate(Miny,Minz);
     }
   else if(Period()==60)
     {
      TF="H1";
     }
   else if(Period()==240)
     {
      TF="H4";
     }
   else if(Period()==1440)
     {
      TF="D1";
     }
   else if(Period()==10080)
     {
      TF="W1";
     }
   else
     {
      TF="MN";
     }

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   ObjectDelete("SymbolName");

  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {

   ObjectCreate("SymbolName",OBJ_LABEL,0,0,0);
   ObjectSetText("SymbolName",Symbol()+" "+TF,Text_Size,Text_Font,Text_Color);
   ObjectSet("SymbolName",OBJPROP_CORNER,Corner_);
   ObjectSet("SymbolName",OBJPROP_XDISTANCE,Left_Right);
   ObjectSet("SymbolName",OBJPROP_YDISTANCE,Up_Down);

   return(rates_total);
  }
//+------------------------------------------------------------------+
All files in topic