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

Re: [amibroker] Backtesting and TimeFrameExpand(xxx,inWeekly, expandFirst);



PureBytes Links

Trading Reference Links

Hello,
 
I think I made myself prefectly clear in the help file I have referenced previously, but let me make it clearer:
 
you must NOT use expandFirst in your trading system except one case: getting opening price.
 
Every other price field or indicator (that is usually based on CLOSING price) will effectively look into the future if you use expandFirst.
 
MACD is based ON CLOSING price. You MUST NOT use it with expandFirst in weekly mode unless you delay the signal (trading) by one week.
 
AFL produces consistent results no matter in what mode you run it (exploration, indicator, backtest) so all functions behave the same
always. Imagine the mess when each function worked differently in different mode.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
Sent: Wednesday, April 19, 2006 6:19 PM
Subject: Re: [amibroker] Backtesting and TimeFrameExpand(xxx,inWeekly, expandFirst);

Hello Tomasz,
 
I read user guide and I thought that I understand it.. But I thought,that backtesting should work like in the realtime.. But with expandFirst it works different..  Maybe Im confused, so I'll try explain what happening me..
 
Realtime:
1. At monday, stock going higher -> so weekly MACD (with expandFirst) is higher then previous week
2. my system give me buy signal
3. At tuesday, stock fall down -> so weekly MACD (with expandFirst) change to be lower then previous week
4. buy signal from monday disappear
 
In backtesting, its not buy signal and it not buy stock, but it should buy stock at monday
 
Tommorow, I'll try make some simple example to better explain this problem..
 
Thank you very much...
 
MR
 
 
----- Original Message -----
Sent: Wednesday, April 19, 2006 2:19 PM
Subject: Re: [amibroker] Backtesting and TimeFrameExpand(xxx,inWeekly, expandFirst);

Hello,
 
Please read carefully what is written in the User's Guide http://www.amibroker.com/guide/h_timeframe.html
along with TimeFrameExpand, quote:
 
TimeFrameExpand( array, interval, mode = expandLast ) - expands time-compressed array from 'interval' time frame to base time frame ('interval' must match the value used in TimeFrameCompress or TimeFrameSet)
Available modes:
expandLast - the compressed value is expanded starting from last bar within given period (so for example weekly close/high/low is available on Friday's bar)
expandFirst - the compressed value is expanded starting from first bar within given period (so for example weekly open is available from Monday's bar)
expandPoint - the resulting array gets not empty values only for the last bar within given period (all remaining bars are Null (empty)).

Caveat: expandFirst used on price different than open may look into the future. For example if you create weekly HIGH series, expanding it to daily interval using expandFirst will enable you to know on MONDAY what was the high for entire week.

 

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: roarke555
Sent: Wednesday, April 19, 2006 9:04 AM
Subject: [amibroker] Backtesting and TimeFrameExpand(xxx,inWeekly, expandFirst);

Hi all,

First, thanks for AB.. Its really good appliacations and I'm
spending a lot of time with it. Anyway, looks like I found some
backtesting bug..

I was really suprised with results from my new system, but later I
found that backtesting is cheating probably.. Im using weekly
timeframe to compute MACD and then expanding it to daily and I
wanted use expandFirst.. So I'm getting signals after monday.. I
know, that if week will continue in wrong direction,then signal
disappear.. Its ok, but when I use backtesting, it probably use
values for whole next week and use signal from monday (ie first day
of this week).. So backtesting works with whole week,but buying at
monday and this is why I getting so good results (85% wiinners, 250%
annual return¨)

Could somebody confirm this and help me to get real results ? Or its
bug (feature) in the AB ?:)

thank you very much..
Roarke







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 other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS