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

[amibroker] Re: Need code help



PureBytes Links

Trading Reference Links

> -----Original Message-----
> From: Gary Serkhoshian [mailto:serkhoshian777@x...] 
> Sent: Friday, 29 August 2003 7:37 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Need code help

> 
> How can I get the following code to work.  The correlation function 
> at the bottom of the code is giving a syntax error when I use a 
> variable in the length.

> VLB = IIf(VLBRAWFACTOR == 1, 126, IIf(VLBRAWFACTOR == 2, 252, IIf
> (VLBRAWFACTOR == 3, 378, IIf(VLBRAWFACTOR == 4, 504, IIf 
(VLBRAWFACTOR == 5,
> 630, 756))))); 
> 
> //CORR CHECKS
> CORR = Correlation(ROC(FUND,1),ROC(INDEX,1),VLB);
> 
Since Correlation does not accept variable periods, you may overcome 
this by
CORR=IIF(VLBRAWFACTOR == 1,Correlation(ROC(FUND,1),ROC(INDEX,1),126),
     IIF(VLBRAWFACTOR == 2,Correlation(ROC(FUND,1),ROC(INDEX,1),252),
etc
Dimitris Tsokakis


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/