Hi Martin,
I have never used the new command to capture bar data at the mouse click point. I would actually have to go look it up. Long before they had that command I came up with a work around that actually worked better for me (dropping 6 arrows to mark the waves as I saw them in the market, grabbing that data and sending it to my external program). I can have two sets of these arrows on each chart (1min, 5min, 10min, 15min, 30min an 60min). I made a mistake and only put one on the 10 second bars and I kick myself often for making that mistake. It would probably take me a month of solid programming and debugging to fix that error (8am to 8pm 7 days a week) so I keep putting it off.
As far as instructing MC as to what to do, I use the drawing object text box with a single letter in it to represent the command and I highlight it using the MC_Text_GetActive command to pick up my instruction to do something. I think you have seen that script. I have those drawing object text boxes along the top of the chart and use logic to make sure they are always out of the way regardless of how I adjust the vertical squeeze of the chart. Right now I have only 4 command text I can send to MC. I tend to use only one of them but MC can detect if it is behind the last bar of the chart or before the last bar of the chart and decide what to do based upon that (it just depends on your logic). So I use highlighted and none highlighted in various locations (above/below price and before/after last bar of chart). It works but it takes a while to get it to work correctly. Good old fashion debugging. So you could easily stack two rows of maybe 8 or 10 commands across the top and the same across the bottom and that is a lot of commands to send to MC. I refer to it as interactive programming. The trick is having the code to keep those text boxes out of the way at all times and the logic for that. For anyone first reading about this technique here is the link.
viewtopic.php?f=5&t=7764
It does not have the logic to keep the text boxes at the top or bottom of the chart regardless of squeeze. To do that you need to capture the top and bottom price and calculate a percentage distance from the top or bottom. Here is the code for that.
Code: Select all
{This is normal processing. Your arrow has not had a "highlighted then unhighlighted command sequence" yet}
{The constant positioning of the arrow can only be done here. Once it is highlighted these commands must not execute}
{Note: Locating the arrow must be executed on every tick so manual chart scale adjustments can be detected for repositioning it again}
ArrowLoc = MinutesToTime(TimeToMinutes(Time) - (ArrowSpace * ArrowNum)); {Space the arrows horizontally}
ScreenValHighest = GetAppInfo(aiHighestDispValue);
ScreenValLowest = GetAppInfo(aiLowestDispValue);
IntractiveArrow_Location = ScreenValHighest - ((ScreenValHighest - ScreenValLowest) * .03); {If close above screen middle}
value1 = Arw_SetLocation(Arw_ID[ArrowNum],Date,ArrowLoc,IntractiveArrow_Location);
I have code sort of similar to the above that places a set of vertical lines at the left side of the chart at the top or bottom depending on how close the prices are to the top or the bottom of that chart. It keeps those lines fairly short. They are different colors. I copy one of them and move the copy to mark a trade location. Different colors and line types mean different things. The logic for that is more complex than the above.
John