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

[amibroker] IF / ELSE questions



PureBytes Links

Trading Reference Links



Wow...I was trying to convert some Tradestation code to AB and it looked
like using the IF / ELSE construct would simplify my life....guess
not.
This bit of code generated error messages that make it appear I cannot
use the normal AB data arrays (and use Ref to pick up yesterdays
values).
if
(Ref(BBUY,-1)<99999 AND H>=Ref(BBUY,-1))
     LXSTOP = L-EXITADD;
Does this mean I have to put it within a FOR / WHILE loop that goes thru all the data in this form:
if (BBUY[n-1}<99999 and H[n]>= BBUY[n-1])
        LXSTOP[n] = L[n]-exitadd;       //exitadd is a constant here
This would really add to the complication for me.
Is it possible to code the original line using just normal AB data arrays without the loop and all the subscripts?  If so, how?  I tried IIF but ran into a problem with specifying the not true condition.

TIA Sid

PS: I can see I may have further questions as I work my way through the TS code.  :(







Yahoo! Groups Sponsor












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 the Yahoo! Terms of Service.






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.481 / Virus Database: 277 - Release Date: 5/13/2003