Print text and special graphics from an Indicator or Signal

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
NW27
Posts: 177
Joined: 25 Dec 2010
Has thanked: 40 times
Been thanked: 85 times

Print text and special graphics from an Indicator or Signal

Postby NW27 » 05 Jan 2012

Hi,

Attached is a function to print text easily on a chart, from a indicator OR signal.

Prints Text or a Special Character (WindDing) at a certain Date&Time.
The font Size, position (relative to the current bar) and color can be set.
The text can be either written in a horizontal format or a vertical format.
Note - This function can be used within Signals. Greatly enhancing the veiwing of signal opeartion.

The special characters already defined are -
- Arrows Up,Dn,Left,Right, and in between ie Arrow in a North West direction (ArrNW)
- Triangles Up, Dn, Left, Right both in a Solid and Hollow form.

Examples
PrintText_S(date,time_s,High+3,1,2,black,15,True,"SHORT",False); // "Short" is written Vertically above the price

PrintText_S(date,time_s,ExitLevel,2,2,blue,10,False,"BE",False); // "BE" is written horizontally

PrintText_S(date,time_s,Low-4,2,2,DarkGreen,10,False,"TriHollowDn",True); // Display a Hollowed triangle

Note - The time input requires seconds ie 123456, which equals "12:45:56"

Neil.
Attachments
PrintText_S.zip
(3.67 KiB) Downloaded 645 times

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Print text and special graphics from an Indicator or Sig

Postby arjfca » 10 Jul 2012

Hi,

Attached is a function to print text easily on a chart, from a indicator OR signal.

Prints Text or a Special Character (WindDing) at a certain Date&Time.
The font Size, position (relative to the current bar) and color can be set.
The text can be either written in a horizontal format or a vertical format.
Note - This function can be used within Signals. Greatly enhancing the veiwing of signal opeartion.

The special characters already defined are -
- Arrows Up,Dn,Left,Right, and in between ie Arrow in a North West direction (ArrNW)
- Triangles Up, Dn, Left, Right both in a Solid and Hollow form.

Examples
PrintText_S(date,time_s,High+3,1,2,black,15,True,"SHORT",False); // "Short" is written Vertically above the price

PrintText_S(date,time_s,ExitLevel,2,2,blue,10,False,"BE",False); // "BE" is written horizontally

PrintText_S(date,time_s,Low-4,2,2,DarkGreen,10,False,"TriHollowDn",True); // Display a Hollowed triangle

Note - The time input requires seconds ie 123456, which equals "12:45:56"

Neil.
NW27, How do we print Triangle and Inverted Triangle.

Martin

NW27
Posts: 177
Joined: 25 Dec 2010
Has thanked: 40 times
Been thanked: 85 times

Re: Print text and special graphics from an Indicator or Sig

Postby NW27 » 10 Jul 2012

Have a look in the source code of the printtext for the different styles of built in symbols.
It uses the wing ding font so printtext could be changed to add what ever other symbols you like.
Neil

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Print text and special graphics from an Indicator or Sig

Postby arjfca » 10 Jul 2012

Have a look in the source code of the printtext for the different styles of built in symbols.
It uses the wing ding font so printtext could be changed to add what ever other symbols you like.
Neil
OK, I see

I'm trying to figure how to reference a letter like "r" to display TriHollowUp.

What I want to print is these characters that represent a triangle arrows in Wingding

0215 ×
0216 Ø
0217 Ù
0218 Ú

Thanks for the code

Martin
Montreal, Canada

greenroomhoo
Posts: 62
Joined: 03 Nov 2011
Has thanked: 12 times
Been thanked: 2 times

Re: Print text and special graphics from an Indicator or Sig

Postby greenroomhoo » 19 Sep 2012

thank you so much for posting this...it is so much better than other options for putting stuff on the chart.

THANK YOU

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Print text and special graphics from an Indicator or Sig

Postby javamarket » 12 Aug 2014

I find if I apply this text function to more than 2 workspaces MC becomes unstable / unusable.
It really is a nice way to finally get some new icons on a chart - shame really.


Return to “User Contributed Studies and Indicator Library”