[This message was posted by John Shields of Nomura Securities Co. <john.shie...@nomura.com> to the "Algorithmic Trading" discussion forum at http://fixprotocol.org/discuss/31. You can reply to it on-line at http://fixprotocol.org/discuss/read/6f8bf203 - PLEASE DO NOT REPLY BY MAIL.]
Being the guilty party of the original template, I support the "one and only one" interpretation of XOR. This is by far the more common use case in algo trading--i.e. often you have a list of "mutually exclusive parameters" where the user can only "pick one". Would very much support including this in the Errata of ATDL, as Edits (including those with logicOperator="XOR") in FIXatdl 1.1 *can* have multiple child elements, and there's not much real-world use here for the "odd number must be true" interpretation that purist digital designers would have... atdl4j (atdl4j.org) has a nice recursive short-circuit implementation of the LogicOperator's including the "one and only one" version of XOR. > > 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 [You can unsubscribe from this discussion group by sending a message to mailto:unsubscribe+100932...@fixprotocol.org] -- You received this message because you are subscribed to the Google Groups "Financial Information eXchange" group. To post to this group, send email to fix-proto...@googlegroups.com. To unsubscribe from this group, send email to fix-protocol+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fix-protocol?hl=en.