Graham, I've seen conflicting comments on that point so I checked the AFL reference for "Status" online. It shows the following;
"firstvisiblebar", "lastvisiblebar", "firstvisiblebarindex", "lastvisiblebarindex" - return bar number or bar index of first/last visible bar. Available in indicator mode only. I used to think "firstvisiblebar" returned a "1", but it does, apparently, return the bar number, as the following code appears to work fine: HVC = Highest(ValueWhen(BarIndex() >= Status("FirstVisibleBar") AND BarIndex() <= Status("LastVisibleBar"), Check)); If you have more recent information, of if I've misinterpreted something, please let me know as I've had some difficulty completely understanding the Status indicators. Thanks, Wayne --- In amibroker@yahoogroups.com, Graham <[EMAIL PROTECTED]> wrote: > > fistrvisiblebar returns a value of 1 on the first bar on screen. So you > would need to use lastvalue(valuewhen(status("firstvisiblebar"),barindex())) > > however I believe there is now status("firstvisiblebarindex") which will > give you the value of barindex > > > > -- > Cheers > Graham > AB-Write >< Professional AFL Writing Service > Yes, I write AFL code to your requirements > http://e-wire.net.au/~eb_kavan/ab_write.htm > > On 01/09/06, wlandry01 <[EMAIL PROTECTED]> wrote: > > > > Herman, > > > > Many thanks to you and all the others who provided input on this. > > Sorry for the delay in responding but I decided to shut the > > computer down while waiting for Ernesto to work his way through > > South Florida. > > > > In any case, I now have my study working! I do have a question, > > however, on the code that you listed: > > > > Plot(C,"",1,128); > > SetBarsRequired(1000000,1000000); > > BlankBarsInRightMargin = 4; > > > > Plot(BarIndex()==Status("FirstVisibleBar"),"",5,styleArea| > > styleOwnScale,-10,10); > > > > Plot(BarIndex()==Status("LastVisibleBar")-BlankBarsInRightMargin,"", > > 4,styleArea|styleOwnScale,-10,10); > > > > When I chart this I get a light green line running from left to > > right on the chart. At the far left there's a small, vertical > > green bar and on the far left there is a red bar. On the far > > right of the chart "0.00000" is shown in both red and green. > > I've discovered that I can "separate" the red and green bars > > (and lines) by adjusting the minimum and maximum setpoints. > > > > I don't understand, however, what generates the green line > > between the two bars (or the red line, for that matter). > > The Plot statement seems to call for a plot when BarIndex() > > is equal to a specific value (the endpoints). I reset the > > Plot statement to show BarIndex()>=Status("FirstVisibleBar") > > and the green bar expands to fill the entire screen, which makes > > sense to me, but I don't see what's generating the line in the > > original code. Does the Plot statement assume a zero value if > > the statement returns false? > > > > Thanks, > > > > > > Wayne > > > > > > --- In amibroker@yahoogroups.com, Herman <psytek@> wrote: > > > > > > Fred, my post did not refer to your code; your code is fine and does > > > what it is supposed to do. I just outlined some problems one may > > > encounter when working with First/LastVisibleBar. > > > > > > The problems I eluded to have all happened to me at one time or another > > > and resulted in a waste of my time. I use RT however I assume the > > > problems can occur in EOD just the same. The problems can easily be > > > confirmed by right-justifying your chart, running my code, > > > adding/removing the SetBarsRequired() and/or changing the number of > > > Blank bars in Preferences. You will note that LastVisibleBar marker > > > appears and disappears depending on what one might have assumed to be > > > unrelated conditions. > > > > > > best regards, > > > herman > > > > > > Fred wrote: > > > > Herman, > > > > > > > > While I'd admit that the statement I posted really should take the > > > > LastValue i.e. > > > > > > > > HVC = LastValue(Highest(ValueWhen(BarIndex() >= Status > > > > ("FirstVisibleBar") AND BarIndex() <= Status("LastVisibleBar"), C))); > > > > > > > > I don't follow the rest of your post ... With or without bars in the > > > > right margin I seem to get the correct result when HVC is plotted ... > > > > > > > > Under what conditions do you not get the correct result ... > > > > > > > > > > > > > > > > > > > > > > > > > > > > Please note that this group is for discussion between users only. > > > > > > > > To get support from AmiBroker please send an e-mail directly to > > > > SUPPORT {at} amibroker.com > > > > > > > > For other support material please check also: > > > > http://www.amibroker.com/support.html > > > > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Please note that this group is for discussion between users only. > > > > To get support from AmiBroker please send an e-mail directly to > > SUPPORT {at} amibroker.com > > > > For other support material please check also: > > http://www.amibroker.com/support.html > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > Please note that this group is for discussion between users only. To get support from AmiBroker please send an e-mail directly to SUPPORT {at} amibroker.com For other support material please check also: http://www.amibroker.com/support.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/amibroker/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/