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

Re: Cross and Exit rules



PureBytes Links

Trading Reference Links

Hi David,

I think that I can help you with the first part of your question - 
and attempt the second:

> buyprice = ref( high,-1 ) + 0.05;
> buy = cross ( high, buyprice);
> 
> However, this does not always trigger an appropriate signal, as 
compared to:
> 
> buyprice = ref( high,-1 ) + 0.05;
> buy = (high >= buyprice );
> 
> What is the difference?

The difference is that the cross function looks for high greater than 
buyprice ( > ) with previous high less than buyprice ( < ). Your 
second equation looks for high greater or equal ( >= )to buyprice. 
(In your case the previous high is always less than buyprice because 
of the '+0.05'.)

> sell =(( high >= (buyprice + 6)) OR ( low <= (buyprice - 4)));
> cover =(( low <= (shortprice - 6)) OR ( high >= (shortprice + 4)));

I think that the problem may be that you are changing the reference 
prices every day with the initial buyprice equation.

You may try:

sell = (( high >= valuewhen ( buy, buyprice, 1 ) + 6 )
OR ( low <= valuewhen ( buy, buyprice, 1 ) - 4 ) );

cover = ( ( low <= valuewhen ( short, shortprice, 1 ) - 6 )
OR ( high >= valuewhen ( short, shortprice, 1 ) + 4 ) ); 


Regards,

Cliff Elion