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

Re: Question Re a TS2000i Coding Problem



PureBytes Links

Trading Reference Links

> How does one prevent [re-entering while still oversold] 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?  

The simplest way is to use code that detects the ENTRY into the 
oversold area, instead of a simple "Oscillator < Oversold" test.

In other words, instead of code like this:

if Oscillator < Oversold then buy;
if Oscillator > Overbought then sell;

...use code like this:

if Oscillator crosses under Oversold then buy;
if Oscillator crosses over Overbought then sell;

That way the system will buy/sell only when the oscillator ENTERS 
the critical area.  If it gets stopped out, it won't buy/sell 
again until the oscillator moves out of the critical area and 
then enters it again.

Gary