Using code: New Text on chart is not kept permanent.  [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: New Text on chart is not kept permanent.

Postby arjfca » 25 Dec 2015

Hello

I want to use a mouse click to show a number over the charts. This number will be use as a reference to take notes on a Notepad .

A key combination using CTRL + SHIFT and a mouse click is showing a text number at the location mouse click. Problem is that the text is disappearing immediately after being showed.

How can I resolve that? Once installed, I want to have the text to be kept on the screen and saved with the charts even if the condition to installed it is not there anymore. ( the condition was a combination of CTRL + SHIFT + mouse click)

Martin

Preliminary code

Code: Select all

{This indicator will use the CTRL + Shift mouse click to show a numeriacal dot on the screen at the location of the charts wher the click was done

Name: TakeNotes by Martin Thriault
Date: December 25 2015

}
[ProcessMouseEvents = true];

Var:
Instrument (getsymbolname),
Scale (Scalestring),
StringNumber (""),
TextVal (0),
FileName (Instrument + Scale),
FileName_B (""),
PairName (""),
BN (0),
PriceVal (0),
CharPos (0);

Once begin
CharPos = Instr(Filename,".");
end;


if (MouseClickCtrlPressed and MouseClickShiftPressed) then begin
CharPos = Instr(Filename,".");
PairName = (Leftstr(FileName, charpos-1)+ midstr(Filename,charpos+1,3) + "_");
filename_B = (Leftstr(FileName, charpos-1)+ midstr(Filename,charpos+1,3) + "_" + midstr(Filename,charpos+4,20));
print (pairname);
BN = MouseClickBarNumber;
PriceVal = MouseClickPrice;

TextVal = text_new_BN(BN, PriceVal, "1");
Text_SetBorder(TextVal, True);
text_SetColor(textVal,Black);
text_setsize(TextVal,14);

end;
Attachments
ShowNumber.png
ShowNumber.png (69.06 KiB) Viewed 551 times

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

Resolved: Using code: New Text on chart is not kept permanen  [SOLVED]

Postby arjfca » 25 Dec 2015

Just found

[RecoverDrawings = False];

From a post of JoshM
viewtopic.php?f=1&t=48673&hilit=text+on+charts#p116104


Return to “MultiCharts”