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

Re: Question Re a TS2000i Coding Problem



PureBytes Links

Trading Reference Links

----- Original Message ----- 
From: "Adrian Pitt" <apitt@xxxxxxxxxxxxx>

> Would someone be able to suggest a possible path to take to prevent a
> position being re-entered when stopped out via a stop order?  For
> example, if a system bought when an oscillator became oversold, and then
> was stopped out via a money management stop of some sort.  TS2000i would
> automatically re-enter you the next day with the original position.  How
> does one prevent this so that another long trade won't occur until a new
> short trade has occurred or when the oscillator moves out of oversold
> and re-enters oversold again?  I can imagine this is a very typical
> problem that comes up in coding. I'm hoping that someone can generously
> point me in the right direction :-)

Maybe by doing something like...

Add entrylong and entryshort variables.

If you exit the short trade, you make entrylong true and entryshort false.

Then you start with "if entrylong = true then begin"

and your code for your system.

ending again with if you exit the long trade, you make the entrylong false
and the entryshort true.

and so on and so on.