I want to confirm AFL logic when Buys and Sells occur on the same bar. My code looks like this:
Buy = x < f AND z < n
Sell = x > g AND z > n ;
Short = Sell ;
Cover = Buy;
If there is not a current position, it ignores the signals. If there is a Long position, it switches to Short.
Is this correct?
Clarification: I realize the above logic will not produce simultaneous signals but I have additional conditions that will. Also with additional testing I see that it is not as simple as I have suggested above. I just need to be sure that it is not random when buy/sell signals fire on the same bar.
I found this reference in another post. I can work thru it with this.
Scroll down to: RESOLVING SAME BAR, SAME SYMBOL SIGNAL CONFLICTS