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

Re: system: how to avoid reenter after exit



PureBytes Links

Trading Reference Links

Even though you are exiting a long trade, say, with a stoploss or a profit
target, your indicator val is still greater than val[1], so when your
program gets to

if val>val[1] then buy market;

you will immediately, on the same bar, buy your position back again.  If you
don't want to take another trade in the same direction you need to say so
with something like:

if val > val[1] and ((MarketPosition=0 and MarketPosition[1]=-1) or
Marketposition=-1) then buy market;

or

if val > val[1] and val[1] < val[2] then buy market;

The first one will only take a trade if either you are flat and the last
trade was short or if you are currently short.  The second one will only
take a trade when the val indicator reverses.  Both of these do what you
want, I think.  Take your pick.


Regards,
Aaron Schindler, CFA

Schindler Trading
1243 Yorkshire Lane
Barrington, IL 60010
telephone: 847-719-2846
fax: 847-719-2846
email: aaron@xxxxxxxxxxxxxxxxxxxx
www.schindlertrading.com


----- Original Message -----
From: "Uli" <URBerger@xxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Wednesday, September 11, 2002 11:36 AM
Subject: system: how to avoid reenter after exit


> Hello,
>
> I´m new to Easy Language and I run in the following problem: When my
system
> exits a trade, it reenters the trade immediately in the same direction.
But
> I will reenter only when the system give me a signal in the opposite
> direction.
>
> E. G. when I write a system like:
>
> ----------------------------
> Var: val(0);
>
> Input : Price(close) , Length(X) ;
>
> val = Indicator (Price, Length);
>
> if val > val[1] then buy market ;
>
> if  val < val[1] then sell market;
>
> -------------------------------
>
> When I added a stop los or a profit target exit via the Strategy Builder,
> the system reenters in the same direction. I guess I should use the
reserved
> word <marketposition>. I try it without success.
>
> The system should behave like this: after an exit it should wait still a
> opposite signal ist generated - if stopped out, wait still a opposite
signal
> is generated and so on.
>
> Any help is appreciated
>
> Uli
>