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;