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

Re: [amibroker] AFL error



PureBytes Links

Trading Reference Links

Hi Ara,
 
See the note below from TJ - possibly your laptop processor handles something a little differently than your desktop processor...?
 
You could also try SetBarsRequired( 100000, 100000 ) to "shut off" QuickAFL if you are not already using it...
 
From TJ:
 
When QuickAFL is ON, the BarIndex() may not be equal with array item index.

Actual array item
corresponding to bar index can be found this way:

bi = BarIndex();
arrayitem = SelectedValue( bi ) - bi[ 0 ];
"Close at selected bar:" + Close[ arrayitem ];
 
----- Original Message -----
To: AB-Main
Sent: Wednesday, November 30, 2005 7:32 PM
Subject: [amibroker] AFL error

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