PureBytes Links
Trading Reference Links
|
I discovered that TradeStation "does not always" properly exit at the last
swing low with a strength of 1 when the following code is used:
{
If MarketPosition = 1 then ExitLong at SwingLow(1,L,1,50) stop;
}
I had decided to "not" use the above code because it is possible that TS will
not find a swing low within the length (50) that the user specifies. This
will result in erroneous system results. However, when the length was
properly set and the maxbarsback were not a issue, I noticed that TS would
"still" occasionally fail to exit on the proper bar. I had noticed this
after I was having trouble with code that I had substituted for TS's
SwingLow(1,L,1,50). I went back to SwingLow(1,L,1,50) and made sure the
length and maxbarsback were OK to test the same exits that were failing with
my substituted code and I I got the same errors.
Here is the exit code I substituted for SwingLow(1,L,1,50).
{
Vars: LowLow(0);
If L[2] > L[1] and
L[1] < L then
begin
LowLow = L[1];
end;
If MarketPosition =1 then ExitLong at LowLow stop;
}
Can someone tell me why this occasionally exits incorrectly?
|