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

RE: [amibroker] EMA returning {INF}



PureBytes Links

Trading Reference Links

Terry

I also had the line SetBarsRequired(10000,10000); which must have been interfering with the array calculation i.e. interfering with AB using the shortest data length. I removed the line and it works fine!

Thanks for the feedback. It’s great having people like you willing contribute so much on the forum!!

Peter

 

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Terry
Sent: Tuesday, 6 September 2005 12:11 p.m.
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] EMA returning {INF}

 

Peter,

 

I don’t have back-adjusted futures contracts, but I put your code in, used two ETFs and added some plot statements. It works fine. I have an EMA formula in Excel and put in some negative prices and it doesn’t blow-up. Must be something to do with your data? I know the different lengths aren’t a problem as Amibroker automatically starts with the shortest one (plus 10 days in your example).

 

SetForeign("IWM");

    fcA = C;

RestorePriceArrays();

 

SetForeign("SMH");

    fcB = C;

RestorePriceArrays();

 

Spread = fcA/fcB;

 

EMASpread = EMA(Spread  ,10 );

 

Plot(spread,"spread",colorBlue);

Plot(EMASpread,"EMA",colorRed);

--

Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Peter
Sent: Monday, September 05, 2005 17:17
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] EMA returning {INF}

 

Hi

I want to calculate the EMA of the spread between two foreign tickers but find the EMA function returns {INF} (infinite). 

 

The code below calculates the spread OK but when included into EMA function it returns {INF} (infinite). 

 

The two foreign Tickers are back adjusted futures contracts with some of the early data negative and also they  have different data lengths, if that makes any difference?

 

I assume the spread array supplied to the EMA function is incompatible?

 

Any help would be appreciated.

Thanks

Peter

 

SetForeign(tickerA);

fcA = C;

RestorePriceArrays();

 

SetForeign(tickerB);

fcB = C;

RestorePriceArrays();

 

Spread = fcA/fcB;

 

EMASpread = EMA(Spread  ,10 );

 





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