Hello
I got an indicator that I use to capture bar data info.
Actually, I need to run the "'MouseClickBarNumber" indicator for each Instruments under my workspace.
Is it possible to detect under witch chart data the mouse is over?
Martin
Is it possible to detect MouseOver data1- data2 - data3 [SOLVED]
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Is it possible to detect MouseOver data1- data2 - data3 [SOLVED]
Hi Martin,Is it possible to detect under witch chart data the mouse is over?
Try MouseClickDataNumber.
Re: Is it possible to detect MouseOver data1- data2 - data3
Hello JoshHi Martin,Is it possible to detect under witch chart data the mouse is over?
Try MouseClickDataNumber.
I already use this function in an indicator. If I load 3 instruments on a workspace, I need to install 3 time this indicator. My interrogation is more like, can I install it on one instrument and have it read the other instruments
Martin
Here is my code. A click over a bar will read the bar info and set a global variable
A click on my Excel sheet over a macro button, will read the data and transfer it to the proper cells
Code: Select all
//Mouse_Click_Bar_Number by Martin Thériault
//Created on June 2013
//
[ProcessMouseEvents = true]
vars:
Comma (""),
Astring (""),
vClickBarHigh_S (""),
vClickBarLow_S (""),
vClickBarOpen_S (""),
vClickBarClose_S (""),
vClickBarNbr(0),
vLastBar(0),
vBarsAgo(0),
vClickBarHigh(0),
vClickBarLow(0),
vClickBarOpen (0),
vClickBarClose (0),
vClickPrice (0),
vclickdatetime (0),
vclickDateTime_S (""),
AmouseClick (false),
ClickTime (0),
clickDate (0),
UpArrow (True),
BarNumberTarget (0),
GVVal (0);
Once Comma = ",";
if MouseClickshiftPressed then begin
Amouseclick = True;
vClickBarNbr = MouseClickBarNumber;
vclickdatetime = MouseClickDateTime;
vClickPrice = MouseClickPrice;
end;
If amouseclick = true then begin
vLastBar = BarNumber + MaxBarsBack;
vBarsAgo = vLastBar-vClickBarNbr ;
if vBarsAgo >= 0 then begin
vclickbarhigh = high[vBarsAgo];
vClickBarOpen_S = NumtoStr(Open[vBarsAgo],5);
vClickBarHigh_S = NumToStr(high[vBarsAgo],5);
vClickBarLow_S = NumToStr(low[vBarsAgo],5);
vClickBarClose_S = NumToStr(Close[vBarsago],5);
GvSetNamedString("BarInfo",vClickBarOpen_S + comma + vClickBarHigh_S + comma + vClickBarLow_s + comma + vClickBarClose_S + comma + GetSymbolName);
Arw_New_DT(vclickdatetime, vClickPrice ,UpArrow);
Print (vclickdatetime, " ", vclickprice:5:5);
If vClickPrice > high[vBarsAgo] then
Astring = "LONG" + comma + vClickBarOpen_S + comma + vClickBarClose_S
else
Astring = "SHORT" + comma + vClickBarClose_S + vClickBarOpen_S ;
GVVal = GVSetNamedString("A_BAR_DATA",astring + comma + GetSymbolName + comma + scalestring);
end;
end;
If amouseclick = true and lastbaronchart_S then amouseclick = false;
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Is it possible to detect MouseOver data1- data2 - data3
Does MouseClickDataNumber not work for you? I have tested it on MC x64 build 7634 and it properly returns the data series value I have clicked on, when I have multiple subcharts and the indicator is applied to the chart only once.I already use this function in an indicator. If I load 3 instruments on a workspace, I need to install 3 time this indicator. My interrogation is more like, can I install it on one instrument and have it read the other instruments
You can use the value MouseClickDataNumber returns to reference a certain data series prices from your code.
Re: Is it possible to detect MouseOver data1- data2 - data3
In fact, I was not aware of the MouseClickDataNumber functionDoes MouseClickDataNumber not work for you? I have tested it on MC x64 build 7634 and it properly returns the data series value I have clicked on, when I have multiple subcharts and the indicator is applied to the chart only once.I already use this function in an indicator. If I load 3 instruments on a workspace, I need to install 3 time this indicator. My interrogation is more like, can I install it on one instrument and have it read the other instruments
You can use the value MouseClickDataNumber returns to reference a certain data series prices from your code.
I will look at it this weekend
Many thanks
Martin