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

[amibroker] Re: IF / ELSE questions



PureBytes Links

Trading Reference Links

I just switched to the web site as the emails are not coming thru on 
a consistant basis.

Jayson, that is the rub....there is no clearly defined else 
condition.  I guess I am supposed to substitute the original variable 
for the else condition.  Please see my recent "programming 101" post 
for a better explanation.
Thanks
Sid

--- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> Sid,
> 
> What is the Else side of the equation? What to do if Ref(BBUY,-1)
<99999 AND
> H>=Ref(BBUY,-1) is False?
> 
> 
> Regards,
> Jayson
> -----Original Message-----
> From: Sidney Kaiser [mailto:s9kaiser@x...]
> Sent: Friday, May 16, 2003 12:42 AM
> To: AmiBroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] IF / ELSE questions
> 
> 
> 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@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/uetFAA/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/