Watermark

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Watermark

Postby robocod » Wed Dec 12, 2012 12:19 pm

This indicator simply displays some 'watermark' text at the centre of the chart. This text is the instrument's name, or custom text that you can enter. The date can also be added, in DD/MM/YYYY or MM/DD/YYYY formats.

The indicator might be of use to you if you take screenshots of the charts for your journal or to post on forums.

For best result the text colour should be very close to the background colour, e.g. pale grey when using white background, or dark grey when using black background, etc. I made it a little darker than normal in the screenshot below - just so it would show up well on the screen capture. When displaying the instrument's name, there are 2 formats - with or without the timeframe period, e.g. "EUR/USD" or "EUR/USD (H1)".

Best shown by the following example...

watermark.png


The indicator should be put in the background, as shown here...

watermark2.png


Here's the code (latest version, dated 27/June/2014) ...
watermark.lua
(6.49 KiB) Downloaded 1771 times

Watermark With Placement.lua
(6.6 KiB) Downloaded 43 times
Last edited by robocod on Fri Jun 27, 2014 7:31 am, edited 2 times in total.
User avatar
robocod
FXCodeBase: Graduate
 
Posts: 299
Joined: Thu May 10, 2012 4:25 pm

Re: Watermark

Postby robocod » Wed Dec 12, 2012 3:06 pm

Bug-fix version up-loaded (I messed up with date value). :roll:
User avatar
robocod
FXCodeBase: Graduate
 
Posts: 299
Joined: Thu May 10, 2012 4:25 pm

Re: Watermark

Postby nazaar » Fri Jan 18, 2013 3:10 pm

Hello,

could you add an option for user to adjust font size and location of watermark? top, bottom, left and right?

thanks.
nazaar
FXCodeBase: Initiate
 
Posts: 178
Joined: Fri May 27, 2011 2:21 pm
Location: Ontario, Canada

Re: Watermark

Postby robocod » Fri Jan 18, 2013 7:47 pm

nazaar wrote:Hello,

could you add an option for user to adjust font size and location of watermark? top, bottom, left and right?

thanks.


Hmm, this was trickier than I thought - messing around with point sizes (1/72 of inch) to get it spaced properly depending on font sizes, and position - but I think I managed it. Please see attached.
Last edited by robocod on Sat Jun 29, 2013 4:42 am, edited 1 time in total.
User avatar
robocod
FXCodeBase: Graduate
 
Posts: 299
Joined: Thu May 10, 2012 4:25 pm

Re: Watermark

Postby nazaar » Sat Jan 19, 2013 11:08 am

robocod wrote:Hmm, this was trickier than I thought - messing around with point sizes (1/72 of inch) to get it spaced properly depending on font sizes, and position - but I think I managed it. Please see attached.

watermark.lua


Brilliant! Thank you!
nazaar
FXCodeBase: Initiate
 
Posts: 178
Joined: Fri May 27, 2011 2:21 pm
Location: Ontario, Canada

Re: Watermark

Postby Apprentice » Sat Jan 19, 2013 5:26 pm

Here you can find a template that provides a basic mechanism for easy change of orientation for labels. Label Positioning Template Support top-right, top-lef, bottom-left, bottom-right, center and price orientations.
download/file.php?id=5228
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 27951
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Watermark

Postby rplust » Mon Feb 18, 2013 6:34 am

Hi,
the watermark is great. I always was looking for something like this but actually to display the current price? Is it too much to ask if you can do that as an option to chose (price only and/or together)? Thank you!
rplust
 
Posts: 18
Joined: Fri Dec 10, 2010 3:39 am

Re: Watermark

Postby robocod » Mon Feb 25, 2013 1:28 pm

rplust wrote:Hi,
the watermark is great. I always was looking for something like this but actually to display the current price? Is it too much to ask if you can do that as an option to chose (price only and/or together)? Thank you!


Hi, thanks for your interest and question. However, I don't plan to add to current price to the indicator (I don't really see the value in it). Sorry.
User avatar
robocod
FXCodeBase: Graduate
 
Posts: 299
Joined: Thu May 10, 2012 4:25 pm

Re: Watermark

Postby Apprentice » Wed Feb 27, 2013 10:34 am

watermark.png

rplust Try My version.
watermark.lua
(4.4 KiB) Downloaded 1409 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 27951
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Watermark

Postby robocod » Wed Jun 26, 2013 12:58 am

I fixed a small bug when using a single line of text aligned to the top or bottom, it was not entirely on screen. I've also simplified the code.

Here's a screenshot, where I've added 2 instances of Watermark. A central watermark (double line) showing the instrument, timeframe and date. And one in the top-right (single line) showing some specific text - in this case web address of my blog (on 1 line). The end result looks nice for screenshots, etc.

watermark3.png


Here's the updated lua file.

watermark.lua
(6.48 KiB) Downloaded 2382 times
User avatar
robocod
FXCodeBase: Graduate
 
Posts: 299
Joined: Thu May 10, 2012 4:25 pm

Next

Return to Custom Indicators

Who is online

Users browsing this forum: wuhuilin11 and 6 guests