With respect to using selectedvalue() keep in mind
that you are dealing with arrays and need to zero in on the bar and value
of interest. If you don't click on a bar the selected bar is the current
(last) bar. There are other ways of doing what you want and it would
undoubtedly be instructive to investigate them.
As for making the line go from the hhv bar forward of
the current rather than starting at the selected bar
modifying startplotbar should work:
startplotbar = selectedvalue(barindex() - barssince(h
== selectedvalue(hhv(h, hhvperiod)))) - extendline
Bill
----- Original Message -----
Sent: Thursday, April 03, 2008 7:58
PM
Subject: [amibroker] Re: Creating a HHV
Indicator
> Hi
Bill > Not sure i need the "Selected Value" as i only want to see the
> current Bar's Highest High. > > This is the code i have,
as per your suggestions... > > hhvperiod = Param("hhvperiod", 50,
5, 1000, 1 ); > extendline = Param("extendline", 5, 0, 15, 1, 0); >
startplotbar = SelectedValue(BarIndex()) - extendline; >
Plot(IIf(BarIndex() >= startplotbar, SelectedValue(HHV(H, >
hhvperiod)), Null), "", colorRed, styleLine, Null, Null, extendline); >
> As you can see if you select a Bar on the chart the line will show
> the HHv line for that Bar. And if no bar is selected it shows a
line > from the current bar not going back to the last HH Bar. >
> I am starting to confuse myself here, all i wish to see is a line
> from the last HHV bar going out to the right past the current
Bar. > > I have tried changing the code myself but failed.
Any further > thoughts? > > Crash > > >
> > > --- In amibroker@xxxxxxxxxxxxxxx,
"wavemechanic" <timesarrow@xxx> > wrote: >> >>
Sorry (getting late). Just noticed that startplotbar is wrong: >>
>> startplotbar = selectedvalue(barindex()) - extendline; //hhv line
> starts at selected bar >> >> Don't have time now to
work out starting from hhv bar so take a > crack at it. >>
>> Bill >> >> >> -----
Original Message ----- >> From: wavemechanic
>> To: amibroker@xxxxxxxxxxxxxxx
>> Sent: Wednesday, April 02, 2008 10:55
PM >> Subject: Re: [amibroker] Creating a HHV
Indicator >> >> >> Not sure I fully
understand what you want but try something along > these lines which
assumes that you select a bar and that you only > want the HHV line drawn
from the HHV bar associated with the selected > bar. If that's not
right then you can tweak the code to produce what > you want. >>
>> hhvperiod = param("hhvperiod",
.... >> extendline = param("extendline", ...; //max = blank
space > specified in preferences >> startplotbar =
selectedvalue(hhv(h, period) - extendline; >>
plot(iif(barindex() >= startplotbar, selectedvalue(hhv(h, > period)),
null), "", color, styleline, null, null, extendline); >>
>> Bill >> >> -----
Original Message ----- >> From: "crashoz"
<crashoz@xxx> >> To: <amibroker@xxxxxxxxxxxxxxx> >> Sent: Tuesday, April 01, 2008 7:14
PM >> Subject: [amibroker] Creating a HHV
Indicator >> >> >> > Hi,
>> > I am trying to create a indicator that that plots
the HHV value >> > (Selectable periods) and projects it
forward from the HHV past > the >> > current
period by a certain value say "5 periods" >> >
>> > The code i have so far is: >>
> >> > Lookback = Param("Look Back Period", 50, 5,
1000, 1 ); >> > >> >
Plot(HHV(H,Lookback), " HHV ", colorGreen, >> >
StyleLine|styleNoRescale,Null ,Null ,Null ); >> >
>> > >> > What i am still
looking for >> > 1. How do i increase the line past the
current Period >> > 2. Can i remove all lines/plots
prior to the last Higest High > (HH), so >> >
that the chart only shows the line from the last HH for the > period
>> > selected. >> >
>> > Hope this makes sense, i am quite new to Amibroker
and sill > grasping >> > the
AFL. >> > >> > Any help would
be great. >> > >> >
Crash. > > > ------------------------------------ >
> 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 NEW RELEASE
ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > 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/ > > <*> Your email settings: >
Individual Email | Traditional > > <*> To change settings
online go to: > http://groups.yahoo.com/group/amibroker/join > (Yahoo! ID required) > > <*> To
change settings via email: > mailto:amibroker-digest@xxxxxxxxxxxxxxx > mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx > > <*> To unsubscribe from this group, send an email
to: > amibroker-unsubscribe@xxxxxxxxxxxxxxx > > <*> Your use of Yahoo! Groups is subject
to: > http://docs.yahoo.com/info/terms/ > > > > -- > No virus found in this
incoming message. > Checked by AVG. > Version: 7.5.519 / Virus
Database: 269.22.6/1360 - Release Date: 4/4/2008 6:02 PM >
>
__._,_.___
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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
__,_._,___
|