Using code: Finding "Text" on a chart  [SOLVED]

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Using code: Finding "Text" on a chart

Postby arjfca » 01 Oct 2014

Hello

Is there a way that I could look on a chart to find a given text that was manually intalled and if found replace it?

I did look in the Text Manipulation code but did see nothing regarding that.

Martin

User avatar
Henry MultiСharts
Posts: 9093
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2923 times

Re: Using code: Finding "Text" on a chart

Postby Henry MultiСharts » 01 Oct 2014

Hello Martin,

Do you want to find a specific string using code?

arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Re: Using code: Finding "Text" on a chart

Postby arjfca » 01 Oct 2014

Hello Martin,

Do you want to find a specific string using code?
Yes

I want to adjust to the right side of the screen some specific commentary that I put on the screen like "WRB"

I did not found the function that allow me to search trough all text on the chart

Martin

User avatar
Henry MultiСharts
Posts: 9093
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2923 times

Re: Using code: Finding "Text" on a chart

Postby Henry MultiСharts » 01 Oct 2014

There is no such rebuilt function. You will need to create your own one that loops through all of the drawings on the chart, gets their values and checks if there is one that matches the required string.

arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Re: Using code: Finding "Text" on a chart

Postby arjfca » 01 Oct 2014

There is no such rebuilt function. You will need to create your own one that loops through all of the drawings on the chart, gets their values and checks if there is one that matches the required string.
Henry,
Witch function would allow me to evaluate each drawing

Martin

User avatar
Henry MultiСharts
Posts: 9093
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2923 times

Re: Using code: Finding "Text" on a chart  [SOLVED]

Postby Henry MultiСharts » 01 Oct 2014

Here is a sample code:

Code: Select all

input: What2Find("hello");

Value1 = Text_GetFirst(3);

While Value1 <> -2 Begin
if What2Find = text_getstring(Value1) then break;
Value1 = Text_GetNext(Value1, 3);
End;

Plot1(Value1);


Return to “MultiCharts”