Hi Everyone,

I'm a total newb to AmiBroker and I'm trying to test an idea I have for a 
fairly simple trend following system.

I'm having problems programing my exit/stop system.

Here's the concept in a nutshell:

- Part #1 - Maximum Loss Protection : Initial stop is a fixed dollar
 amount based on volatility - for some reason even this part isn't 
giving me the results I expect, in backtests I'm getting stopped out 
on way smaller moves than I want. 

StopAmount = 2.0 * ATR( 20 );
ApplyStop( 0, 2, StopAmount, 1 );

- Part #2 - Lock in Profits : If my target of say 15% profit is 
reached, then I want to switch to a trailing 1% stop.

- Part #3 - Timed Exit : Since this is a trend following system, if 
my target or stop are not reached in "x" number of days (say 15 as a 
starting point) then sell at the close of the 15th day.


Thanks for any help or if you could just point me in the direction of 
similar code for the logic I'm trying to implement, I'd really 
appreciate it.

Jon

Reply via email to