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

[amibroker] AFL error



PureBytes Links

Trading Reference Links

Using this code to compute relative strength of sectors.
 

CapitalGoodsRef = Ref(CapitalGoods,-Lookback);

CapitalGoods_Delta = CapitalGoods - CapitalGoodsRef; // Price delta in Lookback periods

CG_Perc_Delta1 = CapitalGoods_Delta *100 / CapitalGoodsRef; // % delta

CapitalGoodsVal1 = EMA((CG_Perc_Delta1 - Perc_IndexDelta1),Smooth); // % delta wrt index

Offset = Ref(CapitalGoodsVal1,-Bars); // value at first visible bar

CapitalGoodsVal2 = CapitalGoodsVal1 - Offset; // Shift values to make all equal to zero at start of chart

Offset2 = CapitalGoodsVal1[SelectedValue(BarIndex())]; // value at specified Lookback bars    <==== Problem area

CapitalGoodsVal3 = CapitalGoodsVal1 - Offset2; // Converge all lines at -Lookback Bars

------------------------------------------------------------------------------------------------------------------------------------------------------

This code works well on my primary computer.

When I load it to my backup (laptop) I get index out of range error.

 

Appreciate any feedback

Ara



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