[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] I still learning, Can someone help here?



PureBytes Links

Trading Reference Links

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();



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006