Mike,
Swing high is when a bar's high is higher than either the preceding or following bar. Swing low is where the bar's low is lower than the preceding or following bar. I have no problem in doing that. At Ara's suggestion, I am also able to use arrays to determine the previous swing highs/lows. The only problem I have now is actually marking the top of the bar in question with text, instead of just shapes. I cannot seem to find a method to get the x and y coordinates that Plottext requires without doing it in a for loop using Barcount. There are methods of obtaining Selected Bar coordinates and Mouse coordinates using the low level graphics, but I cannot find a way to get them as I need them without looping. I am sure there is a way, but I just haven't found it. Tom From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Sent: Tuesday, September 23, 2008 2:00 PM To: [email protected] Subject: [amibroker] Re: loop vs arrays Hi, Your explanation is not entirely clear. Specifically; What is your definition of a 3 bar swing high/low? Is it 3 consecutive up bars, or just 3rd bar higher than preceding 2 though 2nd might be lower than 1st, or just highest bar of any consecutive 3, or MA(C, 3), etc...). If you've already written the loop, post it here, for clarity, and someone will point out how to do it using array manipulations instead. Mike --- In [email protected] <mailto:amibroker%40yahoogroups.com> , "TOMSTI" <[EMAIL PROTECTED]> wrote: > > Hello All, > > > > I need to plot a chart that first of all shows 3 bar swing high and swing > lows. After that, I need to show and mark if a swing made a higher swing > than the previous swing (or lower). I can do this using a loop and > remembering the previous swing high or swing low bar, but am wondering if > there is any way of avoiding a loop and accomplishing the same thing? > > > > Any thoughts appreciated. I have gone through the archives and the knowledge > base, but, unless I missed it, I did not find a solution. > > > > Thanks > > Tom >
