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

[amibroker] Code Conversion



PureBytes Links

Trading Reference Links


Hi




I have a section of Tradestation code I would like to convert to AB as 
follows:




For Counter = 52 downto 13 Begin


if linearRegValue(close,Counter,0) > linearRegValue(close,Period,0) 
then Period = Counter;


End ;


Cord = linearRegValue(close,Period,0);




Could anyone suggest how this can be done?




More specifically




1.  What is the AB equivalent of LinearRegValue()




2.  How can an AB function be used within a VBScript For ... Next 
loop?




3  I can write 




x= LinReg(close,10);




it will execute OK, but if I write 




Counter =10;


x= LinReg(close,Counter);




I get the following error 




Bad args


at line 3, column 20


x= LinReg(close,Counter);


-----------------------^




Any help would be appreciated




Ian



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/