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

Coding an initial stop in TS4



PureBytes Links

Trading Reference Links

Greeting all,

Trying to cobble together a system in TS4 using a turn signal that
enters the market close to a SwingLow or SwingHigh, and occasionally is
the SwingBar itself. So far, I'm satisfied with the EL code for the turn
signal but coding the system exits is VERY perplexing.

For the moment, I'd simply like to see how often the turn signal is
profitable after 4 (or "n") days, so I can tinker with it. But during
those four days I also want to scuttle the trade if the market moves
against me far enough that the most recent SwingHigh or SwingLow (the
very turn I'm trying to catch) gets taken out. Trouble is, every so
often the SwingHigh/SwingLow never forms -- there's an instant whipsaw
on the entry bar-- and I'm stuck in the trade for four ("n") bars, which
naturally doesn't reflect the way one would trade under the
circumstances. It seems I need an initial stop which is not calculated
after the close of the bar of entry but is already in place beforehand,
based on the lower of the following two Lows: a) the Low of the SwingLow
bar (if the signal occurs subsequent to the SwingLow) or b) the Low of
the signal day (if the signal day itself forms the swinglow bar).

Can you direct me to a source for exit code commonly used by swing
traders? I'm sure it's out there someplace, and I'm pretty sure anybody
who's ever traded a swing has been over this terrain.

I tried the following but couldn't achieve the desired effect:

FOR LONG TRADES
If MarketPosition =1 and @BarsSinceEntry(0) < 4 then exitlong at
SwingLow(1,L,1,4) stop;

If price simply plummets after my entry, SwingLow never forms and I'm
SOL. Also tried:

exitlong at MinList(SwingLow(1,L,1,4), L[1] ) stop; -- no luck.

Thanks in advance,
Philip Schmitz