Interesting reading. I tried to do a rough and ready M.etatrader expert to investigate this in backtest. I used the close of the last bar and the one before that (i.e. signals for shift = 1 and shift = 2) to avoid "psychic knowledge"
But I am really very new at all this so don't take my coding effort too seriously. It could be a starting point for someone to create something. Let me know if it's useful.
PS. I noticed something while trying to code this. You use the crossing of the MAs as a kind of initial setting, i.e. after that you wait for the PSAR cross. Doesn't that really mean that condition 1 is "if MAFast > MASlow" (for longs, vice versa for sells)? Anyway, that's how I put it in the code because I couldn't see any difference between that and saying that at some point in the past, there has been an MA cross up/down.
Oh, PPS the file is a txt file, just copy paste it into an MQL2 expert to run.
Edit: I noticed a logic flaw in the first version, so I updated a second one.