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

Re: Crossover position



PureBytes Links

Trading Reference Links

Jim

Try this for your Enter Short

a:=RSI(5)>WillR(20)*(-1);
b:=WillR(30)*(-1)>RSI(24);
a=0 AND b AND Alert(b=0,2);

you could also write this as

a:=RSI(5)>WillR(20)*(-1);
a=0 AND Cross(WillR(30)*(-1),RSI(24));

The Cross() picks out the leading edge of a condition but sometimes it is
more useful to have access to the logical 'state' of an expression (one side
compared to the other), not just the cross. In the code above I am looking
for the state of "a" to be zero, and using "b" in the way I have to still
effectively signals a Cross by detecting the leading edge of "b". You can
still use a cross if you want, as in the second example.

Roy

> I wonder if this has been addressed before.  I'm at a loss as to how to
code it.
>
> Below is the system test.
> The problem is that there is a different condition for the buy than there
is for the sell.
> What I would like to have happen is for the "ENTER LONG" Condition to
always go long and once that condition crosses back and if the condition of
the "ENTER SHORT" condition has already crossed, then the system would  go
short.
>
> What is happening is that if the "ENTER LONG" position crosses back over
( and no longer meets the criteria for a long position, and the "ENTER
SHORT" position has already crossed over, then it will not take a short
position, even though both conditions are in a short mode.
>
>
> Enter LONG / Exit SHORT
> Cross(RSI(5),(WillR(20)*(-1)))
>
> Enter SHORT / Exit LONG
> Cross(WillR(30)*(-1)),RSI(24)
>
> Thanks,
>
> Jim
>
>
>
>