[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Exit not occuring at the right bar



PureBytes Links

Trading Reference Links

The blue dots are the values of the exit price, StopPrice, generated by
the middle code below, right after "End else begin". The lower black dot
(at the low of 6.80) on bar (C) is generated by	the 4th line from the
bottom of the code ; "If StopPrice > Low Then  StopPrice = Low ". This
overwrites the upper blue dot (at 6.92) on (C) by the low (6.80) of that
bar.

Why is there not an exit at(C) and how does TS decide at what price to
exit when it does exit as at (A),(B) or (D)?? Changing the O or C but
not the Low on bar (C) does not make an exit. Changing the Low (in the
server) from 6.80 to 6.75 triggers an exit (but 6.76 does not).  So it
seems that a certain price below the StopPrice is needed to trigger an
exit but is it a percentage, 1 point (.125?) or what? (StopPrice of 6.92
-1 point or -.125 =6.795 and the low (6.80) is above this so it seems
that more than 1 point is needed for a trigger).

The differences at (A), (B), (C) and (D) between the low and the
StopPrice that would have occurred if no exit was triggered are
respectively : 0.17, 0.19, 0.17 and 0.10 (StopPrice - low). 

Maybe, since the "ExitLong" line comes last, after StopPrice gets
changed (by the 4th code line from the bottom) to the low of (C) bar,
then the bar (C) did (could) not go below the StopPrice. But why did not
(B) and (A) do the same thing. 

And was not the StopPrice to be used at (C) set at the close of the
previous bar to (C) (is not this the meaning of "NEXT BAR at StopPrice
Stop") ? If so, when the code gets to ExitLong it would read
StopPrice[1]  not StopPrice[0]) or is the ExitLong code line the first
to be read (before a new StopPrice is calculated)? What is the answer
here?

The Parabolic Trailing LX exit code is : 

Inputs: Acceleration(.02), FirstBarMultp(2);
Variables: AF(0), StopPrice(0), MP(0), HighValue(0);

MP = MarketPosition;
If High > HighValue Then HighValue = High;

If MP = 1 Then Begin	
  If MP[1] <> 1 then begin
    StopPrice=Low-Average(TrueRange,3)*FirstBarMultp;
    AF = Acceleration;
    HighValue = High;
  End else begin
    StopPrice = StopPrice + AF*(HighValue-StopPrice);
      If HighValue > HighValue[1] AND AF < 0.2 Then 
        AF = AF + MinList(Acceleration, 0.2 - AF);
  End;
      If StopPrice > Low Then	StopPrice = Low;
End;
If MP = 1 Then
     ExitLong ("PT") Next Bar at StopPrice Stop;

Attachment: Description: ""