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

[amibroker] TC2000 speed



PureBytes Links

Trading Reference Links

PeterJ,

Thanks for the response.  I've already played around with IIF.  
However, my problem lies in implementing IIF (or if for if-else 
statements using arrays) within loops.  IIF seems limited in its 
implementation in a loop.

I can't easily find a way to find the "optimized' value of the 
variable 'Period' (in the code example) without using a looping 
conditional statment of some sort.

Regards,

Graeme Oswin

--- In amibroker@xxxxxxxxxxxxxxx, "PeterJ \(wpq\)" 
<pjcwebpagequery@xxxx> wrote:
> Graeme
> 
> I do not know Tradestation but I believe your solution lies with 
AB's IIF
> function
> (refer: http://www.amibroker.com/guide/afl/afl_view.php?name=IIF)
> 
> Something along the lines...
> 
> Period =
> IIF(linearregvalue(close,Counter,-1)>linearRegValue(Close,Period,-
1),
> 		 Counter,
> 		 Null/*or whatever the false value should be*/);
> 
> Hope this helps.
> ______
> peterj 
> 
> -----Original Message-----
> From: graeme_oswin [mailto:goswin@x...] 
> Sent: Tuesday, 4 May 2004 11:33 p
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Conditional looping question
> 
> Dear all,
> 
> Is it possible to implement Conditional looping in AFL along the 
> lines of the following. For example what is the most effective way 
of 
> translating this Tradestation language example. ( I think.)
> 
> snip ---------------------------------
> For Counter = 13 downto 7 Begin
>  if linearregvalue(close,Counter,-1)>linearRegValue(Close,Period,-
1)  
> then Period=Counter;
> End;
> Cord=linearregvalue(Close,Period,-1);
> ---------------------------------
> 
> From what I read I can substitute the appropriate AFL keywords (eg: 
> linearregvalue = linearreg etc...
> 
> But how do you implement a conditional loop using arrays? AFL "if" 
> command does not appear to operate on arrays only boolean values.
> 
> I'm sure its possible but I'm programmably challenged.
> 
> Regards,
> 
> Graeme Oswin



------------------------ 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/mOAaAA/3exGAA/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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

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