Hello,
I need some big help. I can't seem to get the coding right to deal
with signals made on weekly data. When I use the code below over a
date range, the data in the columns doesn't match up with the real
data.
In the system I'm trying to replicate, signals should be given every
week (weekly ADX(11)>25, and weekly RSI(3) crosses below 50). Then,
I'll monitor the stocks presented for a break of the prior week's
high for a long entry.
When I perform an exploration over a date range, I get signals on a
daily basis. The odd thing is the last day of the range brings back
the weekly ADX, RSI, and ROC, but every successive day prior to the
last day brings back the weekly weekly data for the WEEK prior to
the last in the range. For example, say this is the returned data:
Ticker Date/Time Close RSI ROC ADX
CVG 10/6/2006 20.33 39.36 -1.55 39.60
CEG 10/5/2006 59.20 48.21 -0.70 34.12
IFF 10/4/2006 38.99 49.81 -1.44 42.67
The real data for CVG is the true weekly close, RSI, ROC, and ADX.
But the data returned for CEG actually comes from the weekly data
for the week ending 9/29/2006. The data returned for IFF actually
comes from the weekly data for the week ending 9/22/2006, etc.
My next step would be to backtest this system (which I also have
very little clue on), but if I can't be sure the exploration is
returning the correct entry date, how can I be sure of the backtest
results?
If anyone knows of any "Time Frames for Dummies" article I sure
would appreciate it. I've gone through the help file and I must be
too dense to figure it out. Also, if anyone knows any "Backtesting
for Dummies" articles I would appreciate those as well. My code is
below.
Thank you for your time,
Jeff
//begin code
#include "c:\program
files\amibroker\formulas\include\findhistory.afl";
TimeFrameSet(inWeekly);
Pullback=Cross(50,RSI(3));
Trend=ADX(11)>=25;
myVolume=MA(V,10)>500000;
myPrice=C>2;
myEPSRk=EPSRk>20;
myMA=EMA(C,13)>EMA(C,26) AND C>MA(C,200);
Filter=Pullback AND Trend AND myVolume AND myPrice AND myMA AND
myEPSRk;
AddColumn(C,"Close");
AddColumn(RSI(3),"RSI");
AddColumn(ROC(C,3),"ROC");
AddColumn(ADX(11),"ADX");
AddColumn(V,"Vol",1.0);
AddColumn(QRSRank,"QRS",1.0);
AddColumn(EPSRk,"EPSRk",1.0);
AddColumn(CQIE,"CQIE");
AddColumn(CQIR,"CQIR");
AddColumn(ROE,"ROE");
AddTextColumn(IndustryID(1),"Industry");
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
<*> 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:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/