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

Re: Cross and Exit rules



PureBytes Links

Trading Reference Links

Cliff,

Thanks very much for your posting. Just last night I became 
convinced that your answer to my 2nd question was right, in that 
Amibroker was constantly changing my price because it was embedded in 
a formula. 

I appreciate your answer to my first question and will go and check 
if that is indeed why different results are produced. However, what 
you say makes sense to me now so I'm thinking you are dead on there.

Again, thanks for the help.

Sincerely,

David Beaudoin


--- In amibroker@xxxx, cliffelion@xxxx wrote:
> 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