ktParticipant
New
Hi Experts,
I need some guidance figuring out the AND & OR logic execution. I got an entry with code 1, but not code 2 and code 3 stated below. I couldn’t figure out how did that happen with code 1.
// code 1:
if x OR y AND z then
buy 1 shares at market
// code 2:
if (x or y) AND z then
buy 1 shares at market
// code 3:
if x AND z then
buy 1 shares …
if y AND z then
buy 1 shares …
Just in case it was random (with code 1) can you reproduce (a few times) entry with code 1?
ktParticipant
New
Hi Grahal, in Backtest yes code 1 resulted entry 10/10. Let me relaunch the PRT to test it.
In principle (and by design), how should code 1 run? Eg. it is (x or y) and z? x or (y and z)? Note, The brackets are not written with code 1, I just put them here to elaborate the logic.
Thanks!
ktParticipant
New
Sorry, I forgot to mention code 1 did resulted an entry in real trade with condition y.
Deleted as after editing the same text appeared again as another post??
code 1: if x OR y AND z then
code 2: if (x or y) AND z then
Both above mean the same in PRT Code and should gives the same Trades.
code 3 : X AND Z
code 4: Y AND Z
Either of above should give some Trades coincident with code 1 and code 2, but not the same Qty of Trades as either code 1 or code 2 … assuming you use either code 3 OR code 4 in 1 System.
If you use code 3 and code 4 in 1 System (as x and z OR y and z) then the results should be the same as using either code 1 or code 2.
I suggest to use parenthesis to avoid any misunderstanding when having to mix AND and OR (I always do that).