Keeping text from indicator on screen  [SOLVED]

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Keeping text from indicator on screen

Postby arjfca » 29 Aug 2016

Hello

Text put on chart via an indicator is erased when the chart is reload or modify via a new scale.
When text is manually written on the chart, it will be kept after saving and reloaded.

How can I keep the text created via an indicator to be permanent?

Martin

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Keeping text from indicator on screen  [SOLVED]

Postby TJ » 29 Aug 2016

Hello

Text put on chart via an indicator is erased when the chart is reload or modify via a new scale.
When text is manually written on the chart, it will be kept after saving and reloaded.

How can I keep the text created via an indicator to be permanent?

Martin

You cannot... what is created by an indicator is always changed when the indicator is changed.

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

Re: Keeping text from indicator on screen

Postby arjfca » 29 Aug 2016

Hello

Text put on chart via an indicator is erased when the chart is reload or modify via a new scale.
When text is manually written on the chart, it will be kept after saving and reloaded.

How can I keep the text created via an indicator to be permanent?

Martin

You cannot... what is created by an indicator is always changed when the indicator is changed.
OK. Thanks TJ
Then, easier to put text manually.
Later, I will try to save the Text and attribute to replace them after.

Martin

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: Keeping text from indicator on screen

Postby bensat » 29 Aug 2016

@TJ

What lets you make this statement ?

@arjfca

If your indicator sets a text due to your conditions, write a readable file with the location where the text was set. You can read this file via ELC easily and set the text where it was originally set. You could extend the usage for different time frames etc etc. Some of work, but you can do it AND(!!!) it is not impossible.

Kind Regards.

Ben

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

Re: Keeping text from indicator on screen

Postby arjfca » 29 Aug 2016

@TJ

What lets you make this statement ?

@arjfca

If your indicator sets a text due to your conditions, write a readable file with the location where the text was set. You can read this file via ELC easily and set the text where it was originally set. You could extend the usage for different time frames etc etc. Some of work, but you can do it AND(!!!) it is not impossible.

Kind Regards.

Ben
Hello Ben. Maybe I did not well explain. That exactly that what I intend to do. But for the moment, it is easier to write Text manually since it will stick on the chart.

The Text that I put on screen is only a reference number. I got a routine that will place an incremental number on the chart at the location of a click. These number are not calculate

That routine use the mouse click + shift key to determine the location. A variable is incremented

I use these numbers as a reference on a Note file.

Martin
Attachments
Number.png
(90.81 KiB) Downloaded 1108 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Keeping text from indicator on screen

Postby TJ » 29 Aug 2016

@TJ

What lets you make this statement ?

::

Kind Regards.

Ben

@bensat

What lets you make this statement ?

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: Keeping text from indicator on screen

Postby bensat » 29 Aug 2016

@TJ

Where I am coming from it's a very unfriendly & offensive act to ask a question while being asked for something. But I am able to answer your question.

Due to successful implementation of a database for 'Footprint'-values, at a time Footprint wasn't implemented in Multicharts, we were able to store and reload Footprint-values for each time frame and symbol back to the point it was saved and stored. Same today for 'Bookmap' and many other studies. That makes me believe your answer was wrong.

Kind Regards.

Ben

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Keeping text from indicator on screen

Postby JoshM » 29 Aug 2016

Text put on chart via an indicator is erased when the chart is reload or modify via a new scale.
When text is manually written on the chart, it will be kept after saving and reloaded.

How can I keep the text created via an indicator to be permanent?
I haven't tested this, but what about creating several manual text boxes on the chart, and then having the indicator access those? This latter is something we can do with the Text_GetNext() and Text_GetFirst() keywords.

The idea behind this suggestion is that the text box is not created by the indicator script (no `Text_New_*` usage) and therefore might remain when the indicator is turned off/on.

Otherwise I'd use Ben's approach, since that works for sure.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Keeping text from indicator on screen

Postby JoshM » 29 Aug 2016

I haven't tested this, but what about creating several manual text boxes on the chart, and then having the indicator access those?
It's very cool that MultiCharts can indeed do this. :)

Example:

Code: Select all

Variables:
currentTextBox(0);

once (CurrentBar = 10) begin

currentTextBox = Text_GetFirst(7);

while (currentTextBox > 0) begin

// Update the text and style of the text box
Text_SetString(currentTextBox, "Example");
Text_SetBGColor(currentTextBox, yellow);
Text_SetColor(currentTextBox, red);

// After updating the text box, go to the next
currentTextBox = Text_GetNext(currentTextBox, 7);

end;

end;
Starting with two manually made text boxes on the chart:

Image

Then with adding the indicator the text boxes have their appearance change:

Image

But then if we remove the indicator, the text boxes and their formatting remain:

Image

Now this approach might not work for you, depending if you can know beforehand the approximate amount of text boxes you need. Because when you do know that, you can create a pool of manual text boxes that the indicator can then access and update.

Perhaps giving the text boxes a special feature (like colour, size, or first character of the content) might be a good idea also, since then the indicator can differentiate between the text boxes intended to be updated (since they have that common feature) and the other text boxes (which the script should leave alone).
Attachments
2016-08-29_18-35-19.png
(12.45 KiB) Downloaded 1138 times
2016-08-29_18-35-03.png
(13.1 KiB) Downloaded 1134 times
2016-08-29_18-32-39.png
(12.35 KiB) Downloaded 1135 times

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: Keeping text from indicator on screen

Postby bensat » 29 Aug 2016

@JoshM

Awesome. Thank you. Opens up my mind for even more ideas (set a text file and read it for the variables where and what to set as text in the chart).

Kind Regards.

Ben


Return to “MultiCharts”