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

[amibroker] Entry, exit and ATR trailing stop



PureBytes Links

Trading Reference Links

Hello,

I've written some coding to enter Long or short for moving avg
cross-overs. i.e.
Buy= Cross(ShortMA, LongMA);   Short = sell;
Sell= Cross(LongMa, ShortMa);  cover = buy;

The other exit is a ATR trailing stop. But the problem is: When I make
trailing stop real tight e.g. 0.2, 0.1*ATR, and im hanging it from
prev. day's high,(exiting if today's low is below trail stop).  The
day i get signal to Enter, (for some trades) the entire days range or
at least the low is already below the stop. 

When this occurs i think the backtester doesn't even enter the trade,
since i seem to be missing some trades, compared to when trail stop is
3*ATR. Is this the case? 

I wanted to have it at least enter and exit trade on the same day,not
just skipping them, for comparative purposes in testing exits.

Anyone know how to do this?


I also realized all the chandelier exits that are in the library do
not work "properly" according to Chuck lebeau's method. 

They either allow the exits to move down (long trades) i.e. as ATR
expands.
Or When getting highest value of trail stop since Entry, gets
refreshed each time a redundant buy signal appears. So it gets highest
trail stop since the redundant signal, allowing a shift down in trail
stop.

The Chandelier plugin mentioned i think does not allow you to specify
where to hang trail (i.e. from high or low). If long i think it only
hangs from High etc. (pls correct me if im wrong)

Having said all that does anyone have code of a "proper" chandelier
exit according to chuck lebeau? If so do you mind showing me, i think
my code does it except for problem about the tight ATR stops
(beggining of post).








Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.11/542 - Release Date: 11/20/2006