×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts

Changes

Jump to navigation Jump to search

And

717 bytes added, 10:14, 19 February 2012
no edit summary
A logical (Boolean) operator that returns [[True]] only if both of its operands are true. Logical operators are used in logical (Boolean) expressions that operate with true/false values.
==== Usage ====
<syntaxhighlight>E1 And E2</syntaxhighlight>
Where: [[E]]- true/false expressions ==== Example ====<syntaxhighlight>2=1 And 2=2 will return a value of False
True And True And True will return a value of True<:'''E'''- true/syntaxhighlight>false expressions.
== Notes ==
* If one of the true/false expressions evaluates to false, the whole expression is evaluated as false due to the '''and''' logical operator. For example:
:<syntaxhighlight>(10 > 1) and (10 > 20)</syntaxhighlight>
:Will evaluate to [[False]] since the second expression is not true, even though the first expression (10 > 1) is true.
* The whole expression is evaluated as true if, and '''only if''', all true/false expressions are true. For example:
:<syntaxhighlight>(10 > 1) and (100 < 2000) and (1 = 1)</syntaxhighlight>
:Will evaluate to [[True]] since all individual expressions are indeed true.
* Also see the logical expression [[Or]] for true/false evaluations.
== Examples ==
<syntaxhighlight>2 = 1 And 2 = 2</syntaxhighlight>
Will return a value of False.
<syntaxhighlight>True And True And True</syntaxhighlight>
Will return a value of True.
[[Category:Comparisons and Loops]]

Navigation menu