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

[amibroker] Trailing Stops ???



PureBytes Links

Trading Reference Links

Could someone please calrify how trailing stops work in Ami? Every time I use the stops, 
my trades are generally in the negative as opposed to just using a fixed TP . Obviously 
this doesn't maximize profits on a trend.

My logic tells me that if I set a trailing stop of say, 20 pips, then that should only 
kick in if my trade falls back 20 pips or greater from HHV since entry.  But the backtest 
shows I'm exiting for less than the trail value. As an example I did a trade on the Aud$ 
and entry price was 0.7236. The highest value reached was .7247 and on the next bar the 
trailing stop kicks in at 0.7227.

On another note, how do I code the logic that a trailing stop is only to kick in once some 
many points in profit?
Below is code I've tried but when going back through the exit values on the backtest, 
prices don't match the code logic.

trailstop = ApplyStop(stopTypeTrailing,stopModePoint,0.0020,1);
Buy1 = Time AND H > ValueWhen(TimeNum()==130000,O) + 0.0015;
Buy = Buy1 ;
BuyPrice = Buy + 0.0004; //allow for spread
Sell2 =L <= (ValueWhen(Buy,L) - 0.0002);
Sell = IIf(BuyPrice + 0.0025,Sell2, trailstop);
SellPrice = Sell; 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/