PureBytes Links
Trading Reference Links
|
Because you are asking the wrong question. Plot this and it will help you see why.
A1= HHVBars(C,50); // returns # bars
bs = HHV(C,50); // returns a value
A2=BarsSince(bs == C); // barssince C == high of C
printf("A1=" + NumToStr(A1, 1) + ", A2=" + NumToStr(A2, 1));
Plot(bs, "HHV", colorRed);
Plot(C, "c", colorBlue);
Plot(a1, "A1", colorGreen, styleOwnScale);
HHVBars is the number of bars since C was high.
HHV tells you the value of C when it was high.
The interesting thing is BarsSince C == HHV(C,50) is one less than the value HHVBars returns. It has to do with bar index but I would expect them to return the same value.
Barry
--- In amibroker@xxxxxxxxxxxxxxx, "steve_almond" <me@xxx> wrote:
>
> I was trying to calculate the number of bars since the HHV of price over the past 6 months (126 trading days).
>
> This seems to work:
> A1= HHVBars(C,126);
>
> This doesn't seem to work:
> A2=BarsSince(HHV(C,126));
> It always returns zero.
>
> Why doesn't the second expression work?
>
> Thanks,
>
> Steve
>
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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/
|