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

[amibroker] Yearly pivot from start of the year



PureBytes Links

Trading Reference Links

Hi, I'm trying to find a way to calculate the yearly pivot from the
first trading day of the year. I've been using the following code but
it doesn't display from the start of the year so I don't think I'm
using it correctly:

YearHigh = TimeFrameGetPrice("H",inMonthly*12,-1);
YearLow = TimeFrameGetPrice("L",inMonthly*12,-1);
YearClose = TimeFrameGetPrice("C",inMonthly*12,-1);
YearlyPP = (YearHigh + YearLow + YearClose)/3;

Plot(YearlyPP, "PP",colorRed, styleStaircase+styleNoRescale+styleLine);

Does anyone know how I can get it to start from the beginning of the year?

Another way I've tried is finding the previous year's high by using
YearHigh = LastValue(Highest((Year()==2006)*H)), which seems to work
correctly, but when trying to find the yearly low using YearLow =
LastValue(Lowest((Year()==2006)*L)), YearLow always returns as 0.

Am I using this code incorrectly or does anyone know of another way to
find the high, low and close of the previous year?

Thanks for your help,
Swanny.




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/