Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 00:20:11 +0000



Post From: Is it possible a floating text window in sierrachart?

[2019-11-07 09:22:22]
GiovanniD - Posts: 41
Hi
if not exist I would like to suggest a brilliant idea that has had an MT5 programmer.
In MT5 as in Sierra it is possible to send comments to the console, to see the contents of a variable for example.
The programmer has decided to create a new class that allows to display the string comments line by line in a special window that appears on the graph, which can be moved at will.

It is possible to define the color of the window (background and border), the color of the text, the style of the text, the size of the text

The applications of this idea are practically endless!

Attached 2 application images made by me and the really simple code to implement them..

I hope it is a doable idea even in SierraChart, if not immediately, in the future. I don't think it's complicated .. at the limit, instead of using a floating window on the chart you could immediately use a special space normally dedicated to the indicators .. at this point defining a new class shouldn't be a big problem.

If needed, I also have the source code of the MT5 class, but it's nothing complex, use the basic MT5 commands.

what do you think?

//--- global variables
#define COLOR_BACK clrWhite
#define COLOR_BORDER clrDimGray
#define COLOR_CAPTION clrBlue
#define COLOR_TEXT clrDimGray
#define COLOR_WIN clrLimeGreen
#define COLOR_LOSS clrOrangeRed
CComment comment; //"comment" associated to the CComment class

//--- init zone settings
srand(GetTickCount()); //random number generation
name="panel_"+IntegerToString(rand()); //panel name
comment.Create(name,100,150); // panel creation: name, dimensionX, dimensionY (default initial position, not defined, automatically set in the left part of the chart)
comment.SetAutoColors(InpAutoColors);//colors defined "Auto"
comment.SetColor(COLOR_BORDER,COLOR_BACK,255);//border color assigned to clrDimGray
comment.SetFont("Lucida Console",13,false,1.7);//font, dimension, etc
comment.SetText(0,"FINESTRA : " + name, COLOR_TEXT);//first row (0) of the window, content, color
comment.SetText(1,"PRICE D1 H4 H1 M30 M15 M5", COLOR_CAPTION);//second row (1) of the window, content, color
............ etc
comment.Show();//finally show the window

//--- main and recursive code

for cicle (x>1)//x = row
  {
comment.SetText(x, intest[x-2] + " " + DoubToStringa(D1p,2) + " " + DoubToStringa(H4p,2) + " " + DoubToStringa(H1p,2) + " " + DoubToStringa(M30p,2) + " " + DoubToStringa(M15p,2) + " " + DoubToStringa(M5p,2),COLOR_TEXT);//simply I go to calc all the rows I need and put them in the "comment" as string, if a row exist, simply replace it
  }
comment.Show();//update the window content

//on indicator exit
comment.Destroy();//to remove the class object and delete the window

imageccomment1.jpg / V - Attached On 2019-11-07 09:20:29 UTC - Size: 73.26 KB - 299 views
imageccomment2.jpg / V - Attached On 2019-11-07 09:20:36 UTC - Size: 63.32 KB - 276 views