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

RE: Crossover position



PureBytes Links

Trading Reference Links


Roy,
Thanks for answering.
The formula below with the cross does not work.
I think this is because it will not see the cross as it is past 
tense.
 
The first formula is the way to go, although I see what the Alert is there 
for, it doesn't seem to work as advertized either, in fact there must be 
something I don't understand about the alert function as I have tried in the 
past to get to work with no luck.
 
Thanks again.
Jim
______________
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
>
>
>
>