Page 1 of 2

💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Sat Apr 13, 2024 6:23 pm
by moey_dw
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);
  }
//+------------------------------------------------------------------+

Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Sat Apr 13, 2024 9:06 pm
by Jimmy
This is a good request Moey, nice work on including a basic code too.

Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Sun Apr 14, 2024 4:37 pm
by boytoy
Good idea for multiple screen set up hope it can be done too

Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Mon Apr 15, 2024 8:36 am
by mrtools
moey_dw wrote: Sat Apr 13, 2024 6:23 pm I'd like to make a request for a modern version of an overlooked tool!
Not quite there but maybe a start, haven't figured out a way to do uppercase/lower case letters yet but researching it, hopefully will come up with something.

Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Mon Apr 15, 2024 6:00 pm
by moey_dw
mrtools wrote: Mon Apr 15, 2024 8:36 am Not quite there but maybe a start, haven't figured out a way to do uppercase/lower case letters yet but researching it, hopefully will come up with something.
This is perfect I love it already escpecially because it auto centers....... no more mucking around with adjusting Offset X and Y options & we can display it behind or above the candlesticks!!!

I've found the following settings to be the right size to match Tradingview and Pro Realtime charts:
  • Size: 56
  • Font: Verdana
Try it out I love you Mrtools thank you habibi 😍😍😍


Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Mon Apr 15, 2024 6:26 pm
by Jimmy
mrtools wrote: Mon Apr 15, 2024 8:36 am Not quite there but maybe a start, haven't figured out a way to do uppercase/lower case letters yet but researching it, hopefully will come up with something.
moey_dw wrote: Mon Apr 15, 2024 6:00 pm This is perfect I love it already escpecially because it auto centers.......
Superb. This is the best one now, I love the auto-center and background text display option - makes looking at multiple charts a breeze and it doesn't have the weird glitches that old ones had.

Well done guys 👏

Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Mon Apr 15, 2024 6:42 pm
by BeatlemaniaSA
mrtools wrote: Mon Apr 15, 2024 8:36 am Not quite there but maybe a start, haven't figured out a way to do uppercase/lower case letters yet but researching it, hopefully will come up with something.
Dear mrtools,

As you continue to spoil us with these indicators could you put the icing on the cake for this one by possibly incorporating a blend feature similar to YFX_ind_SymbolWatermark? :D :thumbup:

Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Mon Apr 15, 2024 7:03 pm
by Jimmy
BeatlemaniaSA wrote: Mon Apr 15, 2024 6:42 pm Dear mrtools,

As you continue to spoil us with these indicators could you put the icing on the cake for this one by possibly incorporating a blend feature similar to YFX_ind_SymbolWatermark? :D :thumbup:

2024-04-15_Chart Symbol.png
The blend would make it perfect 👌

Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Tue Apr 16, 2024 2:30 am
by mrtools
BeatlemaniaSA wrote: Mon Apr 15, 2024 6:42 pm Dear mrtools,

As you continue to spoil us with these indicators could you put the icing on the cake for this one by possibly incorporating a blend feature similar to YFX_ind_SymbolWatermark? :D :thumbup:

2024-04-15_Chart Symbol.png
Found a coded version online and added that code to it, think it may be similar.

Re: 💹 Modern Currency Symbol Watermark for MT4 charts

Posted: Sat Apr 20, 2024 3:02 am
by stond
I needed a simple indicator showing only the TF of the chart. I didn't find it, strange.
I removed the symbol from the "symbol - watermark" indicator and it works. If it needs to be done differently, dear coders, please correct it, thank you.
I don't know much about coding :)

best regards
stond