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

Re: [amibroker] ??? -> Variable = Variable!= Ref( Variable, -1 );



PureBytes Links

Trading Reference Links

Hi KB --

The statement has two parts.

The part to the right of the "=" is a statement that must be evaluated down to a single value.
To use a specific:
C != Ref(C,-1)
the "!=" is a comparison operator.
The whole thing is True if the two parts on either side of the comparison are not equal -- != is a not equal operator.
So, if today's close is 20.00 and yesterday's close was 20.50, the statement "C is not equal to Ref(C,-1)" is True, so the right hand side is True.
The "=" is the assignment statement.
Assign the variable on the left the value computed on the right hand side.
So,
Test = C != Ref(C,-1);
assigns True to Test.

It is possible that the variables are all "the same", provided that the variable on the left can take on the value that results on the right.  This can happen here:

OK = OK != Ref(OK,-1);

OK is a logical variable.  Say it was True yesterday and False today.
The right hand side is True, because False != True evaluates to True
So assign True to OK, replacing the previous value of False that it had before this statement.

Hope this helps,
Howard





On Fri, Sep 12, 2008 at 2:16 PM, KBGlenn <kbglenn@xxxxxxxxx> wrote:

I'm not a computer programmer but have seen something like the above
in several pieces of Amibroker code. What does it mean/what does it
do in plain English?

Request a quick assist.

Tks!


__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___