|
I disagree. It is documented quite well in fact.
Basic BACKTESTING TUTORIAL (MUST READ FOR EVERYONE who wants
to run any backtest):
Excerpt:
Trailing stops This kind of stop is used to protect profits as it tracks your trade so each time a position value reaches a new high, the trailing stop is placed at a higher level. When the profit drops below the trailing stop level the position is closed. This mechanism is illustrated in the picture below (10% trailing stop is shown): <
The trailing stop, as well as two other kind of stops could be enabled from user interface (Automatic analysis' Settings window) or from the formula level - using ApplyStop function: To reproduce the example above you would need to add the following code to your automatic analysis formula: ApplyStop( 2, 1, 10, 1 ); // 10% trailing stop, percent mode, exit at stop ON or you can write it using predefined constants that are more descriptive ApplyStop( stopTypeTrail, stopModePercent, 10, True ); Trailing stops could be also defined in points (dollars) and percent of profit (risk). In the latter case the amount parameter defines the percentage of profits that could be lost without activating the stop. So 20% percent of profit (risk) stop will exit your trade that has maximum profit of $100 when the profit decreases below $80. Dynamic stops The ApplyStop() function allows now to change the stop level from trade to trade. This enables you to implement for example volatility-based stops very easily. For example to apply maximum loss stop that will adapt the maximum acceptable loss based on 10 day average true range you would need to write: ApplyStop( 0, 2, 2 * ATR( 10 ), 1 ); or you can write it using predefined constants that are more descriptive ApplyStop( stopTypeLoss, stopModePoint, 2 * ATR( 10 ), True ); The function above will place the stop 2 times 10 day ATR below entry price. As ATR changes from trade to trade - this will result in dynamic, volatility based stop level. Please note that 3rd parameter of ApplyStop function (the amount) is sampled at the trade entry and held troughout the trade. So in the example above it uses ATR(10) value from the date of the entry. Further changes of ATR do not affect the stop level. See complete APPLYSTOP function documentation for more details. Best regards, Tomasz Janeczko amibroker.com __._,_.___ Please note that this group is for discussion between users only. To get support from AmiBroker please send an e-mail directly to SUPPORT {at} amibroker.com For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: http://www.amibroker.com/devlog/ For other support material please check also: http://www.amibroker.com/support.html
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- Re: [amibroker] Re: Applystop trailing stop calculation Mark H
- Re: [amibroker] Re: Applystop trailing stop calculati... Tomasz Janeczko
<
