|
Algorithmic Trading
< Previous Next >
Re: Edit logicOperator="XOR"
Greg Malatestinic / Jordan & Jordan <> 7 May 2010 10:14AM ET According to the FIXatdl-1.1 spec:
".. the logical operators, AND and OR, can have more than two operands. Furthermore, they both perform short-circuit evaluation of their operands. That being the case, it is important that XML parsing or binding libraries maintain the order of the elements as they appear; otherwise unexpected results may occur."
But what abuot XOR? The spec doesn;t say anything about it.
SO here is my interpetation...
All logical operators are binary. However, there is an exception for AND and OR, which can have more than two operands (this was stricly for convenience since most programming languages allow for this). XOR must have two and only two operands. The operator, NOT, must have exactly one operand.
I realize that we can get a creative and let XOR have multiple interpretations (one and only one from a set, two and only two from a set, three but not more than four, etc.), but that's the programmers job, or in this case the FIXatdl author's job.
So I think you'll need to re-write the <Edit> to something like this:
<Edit logiOperator="OR">
<Edit logicOperator="AND">
<Edit operator="EX" field="Field1"/>
<Edit operator="NX" field="Field2"/>
<Edit operator="NX" field="field3"/>
</Edit>
<Edit logicOperator="AND">
<Edit operator="NX" field="Field1"/>
<Edit operator="EX" field="Field2"/>
<Edit operator="NX" field="field3"/>
</Edit>
<Edit logicOperator="AND">
<Edit operator="NX" field="Field1"/>
<Edit operator="NX" field="Field2"/>
<Edit operator="EX" field="field3"/>
</Edit>
</Edit>
-Greg
Re: Edit logicOperator="XOR" Greg Malatestinic / Jordan & Jordan 7 May 2010 10:14AM ET |