PureBytes Links
Trading Reference Links
|
> If your position exits, then re-enters on the same bar based on the
> logic that MP = 0, a Signal "knows" that you went from say MP=1, to
> MP=0, to MP=-1 all within the same bar. To an indicator, you simply
> went from MP=1 to MP=-1. Indicator logic doesn't detect the MP=0
> condition intrabar.
Ah, good point. Positions reversing within a bar was one of
those sticky cases that I forgot about. I believe if you change
the code to:
if MP = 0 then I_BarsSinceEntry = 0
else if MP[1] <> MP then I_BarsSinceEntry = 1
else I_BarsSinceEntry = I_BarsSinceEntry + 1;
....it should cover that case. At least it should be closer. :-)
Gary
|