I'm still learning and need help.  Most of the code I've figured out, 
then I have problems when it comes to arrays and sorts.

I'm trying to figure the minutes in the Value Area in the code below:

I can't figure out if I need to use a for loop or increment a varible 
or use an array.  

The Valua Area in the code is the area between VAHigh and VALow.

(1) Figure the minutes in Value Area and place results in Title.
(2) If out of the Value Area then 0


Thanks,

RichardF


_SECTION_BEGIN("Value Area based on Price");
// Value Area Based On Price


Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() );

VAinthearea2 = 0;

BI = BarIndex();
LVBI = LastValue(BI);
TN = TimeNum();

Bot = TimeFrameGetPrice("L", inDaily, -1);
Top = TimeFrameGetPrice("H", inDaily, -1);


percent1 = .70;
CL = (Top + Bot)/2;
StdDev = (Top - Bot)/2;
UValue = CL + StdDev * percent1;
LValue = CL - StdDev * percent1;
VAHigh = UValue;
VALow = LValue;

Plot(IIf(tn >= 83000 AND tn <= 145900, UValue, Null), "VA-H",
colorBlue,styleLine|styleNoRescale);
Plot(IIf(tn >= 83000 AND tn <= 145900, LValue, Null), "VA-H",
colorLightBlue,styleLine|styleNoRescale);


VAinthearea = IIf(C < VAHigh AND C > VALow, 1, 0);
VAinthearea2 = WriteIf(C < VAHigh AND C > VALow, "yes", "no");

// Figure Minutes in Value Area

x = VAinthearea; //Edit Here 
VAminutes = x; //Edit Here


Title = Name ( ) + ", " + Date ( ) + " - " +
"\n " + "VA in the Area = " + VAinthearea +
"\n " + "VA in the Area = " + VAinthearea2 +
"\n " + "Minutes in Value Area = " + VAminutes ;
_SECTION_END();




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:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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/
 

Reply via email to