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

[amibroker] Re: trailing stop & profit



PureBytes Links

Trading Reference Links

Hi.  Below are a few comments (which may already be clear to the reader).

As pointed out:  

>we cannot say for 100% what happened inside the bar.

This is often the crux of the matter when it comes to "incredible" results sometime observed from an incorrectly constructed backtest.

General guideline:  If your entries and exits happening on the same bar at any point during your backtest, then the results are bogus.

In all cases using stops and targets together, for a backtest result to have basic retrospective validity, it is necessary that the "path of price" be available to unambiguously decide which got hit first.

Put another way, the stops and targets need to be far enough apart that a single bar will never span them on the TF under test.

BTW, there are some softwares that actually offer "inside the bar" backtesting, using underlying data of a higher resolution - but AB does not (AFAIK).  The utility of this is to make it dead-simple for the user (programmer) to generate signals on a higher TF (the chart TF, e.g. 60m), while modeling stops and targets correctly on a lower TF (e.g. 1m, or ticks) _during_ the first (and subsequent) HTF bars.

AB's approach to this is to offer TimeFrameCompress(), which models the HTF bars for the programmer who is operating on LTF data.  (AB backtesting via the AA window operates against the database, rather than against a chart.)

Two different approaches to the same general issue ...  (IMO)


--- In amibroker@xxxxxxxxxxxxxxx, "wavemechanic" <fimdot@xxx> wrote:
>
> http://www.amibroker.com/guide/h_backtest.html
>   ----- Original Message ----- 
>   From: Radek Simcik 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: March 19, 2009 9:58 PM
>   Subject: [amibroker] trailing stop & profit
> 
> 
>   Hi,
> 
>   could anybody explain to me how trailing stop works?  I have below
>   setting in my system ( I short on open and exit the same day on
>   close):
> 
>   ApplyStop(stopTypeTrailing,stopModePercent,4 ,1);
>   SetOption ("ActivateStopsImmediately", True);
> 
>   in that case it seems to me that stop starts to trail to protect my
>   gain only if the gain is more than 4%. I thought that the trade would
>   be exited if price fell more than 4% below low.
> 
>   What would happen if both happened during the day: the price went up
>   more than %4 and low more than 4%. It seems to me that I am going to
>   experience gain every time although we cannot say for 100% what
>   happened inside the bar.
> 
>   Could somebody explain me how ApplyStop(stopTypeTrailing,3,4 ,1);
>   work? It gave me just unbelievable results.
> 
>   Thank you,
> 
>   Radek
> 
> 
>   ------------------------------------
> 
>   **** IMPORTANT PLEASE READ ****
>   This group is for the discussion between users only.
>   This is *NOT* technical support channel.
> 
>   TO GET TECHNICAL SUPPORT send an e-mail directly to 
>   SUPPORT {at} amibroker.com
> 
>   TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
>   http://www.amibroker.com/feedback/
>   (submissions sent via other channels won't be considered)
> 
>   For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>   http://www.amibroker.com/devlog/
> 
>   Yahoo! Groups Links
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/