Wayne:
 
Your numBars is "backwards" and needs to subtract Begin from End otherwise you have a negative number.  Also, the only place that you need LastValue is in the HighValue line. So this should work:
 
numBars = (end - begin + 1);
highValue = LastValue(C, numBars);
testValue = .9 * highValue;
 
 
 
----- Original Message -----
From: "wlandry01" <[EMAIL PROTECTED]>
To: <amibroker@yahoogroups.com>
Sent: Tuesday, August 29, 2006 9:19 AM
Subject: [amibroker] Need Help With FirstVisibleBarIndex

>
> Hi,
>
> I'm trying to set up an indicator that will calculate the HHV for the
> current chart so that I can do a PlotGrid at 90% of that highest value
> shown on the chart.  I thought the following would do this:
>
> //Calculate the Number of Bars Shown on the Current Chart
> Begin=Status("firstvisiblebarindex");
> End=Status("lastvisiblebarindex");
> NumBars=LastValue(Begin-End+1);
>
> //Determine the HHV of the Chart and Calculate 90% of that Value
> HighValue=HHV(C,NumBars);
> TestValue=0.9*LastValue(HighValue);
>
> //Plot the Result
> PlotGrid(TestValue,ColorDarkRed);
>
> It appears, however, that the "Begin" and "End" values are not
> returning the index values associated with the chart.  As far as I can
> tell, I'm getting "1" for all values.  I can't for the life of me
> understand what the problem might be. 
>
> Any help would be greatly appreciated.
>
>
> Wayne
>
>
>
>
>
>
> 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/

>
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.11.6/428 - Release Date: 08/25/06
>
>
__._,_.___

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






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to