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

Re: Trailing Stops



PureBytes Links

Trading Reference Links

> Could someone help be with this coding problem?
> 
> I am attempting to develop an exit strategy based on trailing stops.
> 
> I want to exitlong if close <= 8%(Close,50)

Just a general comment rather than any specific code. Computers are
extremely 'literal'. They only do what you say. They can't guess what
you really mean. So, the first step is to correctly formulate your
rules. I would *guess* that what you really mean above is...

   I want to exitlong if close <= 92%(Close,50)

or maybe

   I want to exitlong if close <= 92% Highest (Close,50)

Once you have your rules straight, the code is easy.

   exitlong .92 * close[50] stop;

or

   exitlong .92 * highest(close,50) stop;

-- 
   Dennis