Thanks guys. Yes Ive never done porfolio testing before so Im trying to learn. Ive saved my amibroker backetest settings .abs How do i upload them?
Here is the report
View attachment 46943
Sorry, missed that post! Rename the file extension .abs to .txt and then upload it via manage attachments. So anyone can download that file and rename txt back to abs again.Too bad this forum doesn't allow zip or rar archives. At least I can not see them listed.
Ive backtested it on asx all ords from 1/1/2004 to 20/4/2012.
Hello
Ive been trying to learn how to set up and backtest a few systems and I must have a problem because all of them give very low results. I have attached a afl of techtrader that I have. Ive backtested it on asx all ords from 1/1/2004 to 20/4/2012. I click backtest-portfolio backtest and then I click on report. The report that I get says that the annual return was 2.54%. Could someone please backtest this afl and tell me what the results are. Thank you
What do you wanna prove anyway? I don't quite get it. Do you wanna prove AB being wrong because ... ? I doubt you will succeed.
Hi Gringotts Bank.
Thanks for the settings. I will alter mine and see if that helps. I am interested if most people here have similar settings. From the reading that I have done the number of positions should be between 10 and 20 to be manageable and also to make position sizing work.
Regarding entry next open, I understand what you are saying. I selected the next days open because most of the systems that have been published seem to do that. Even the techtrader system was already like that. I have not changed it. As for allow position size shrinking Im trying to have 10 equal sized positions.
Just curious what others are doing.
As for joshsmi's comment on what are you trying to prove? You're trying to prove that your backtested results are realistic and accurate. Rather than the result of some glitch because you didn't set the backtesting settings up correctly. You're doing the right thing. It's important to understand the system you're using as well as ensuring that the backtested results are accurate.
Thanks guys. Yes Ive never done porfolio testing before so Im trying to learn. Ive saved my amibroker backetest settings .abs How do i upload them?
Here is the report
View attachment 46943
//Plot Price Chart
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
SetBarsRequired( sbrAll, sbrAll);
// Techtrader v2 amibroker version
//Backtester settings
SetOption("InitialEquity", 100000 ); // Initial trading equity of 100000
SetOption("MaxOpenPositions", 10 ); // This sets maximum number of open positions
PositionSize = -10; // Always invest only 10% of the current Equity
SetOption("CommissionMode",0); //Use Commissions Table in Backtester. Min $15 per trade or 0.20% whichever is the larger.
SetTradeDelays(1,1,1,1); // Delay Entry and Exit by one day.
BuyPrice=Open;
SellPrice=Open;
// Here we define buy conditions and name each one as a variable
cond1=Cross(H,Ref(HHV(H,10),-1)); // when todays high crosses last highest high over the last 10 periods
cond2=H > EMA(C,40); // todays high is greater than the 40 day Exp MA of closes
cond3=HHVBars(H,70) == 0; // todays high is the highest for 70 periods
cond4=EMA(V*C,21) > 500000; // ensure at least $500k of money flow
cond5=C < 10; // only trading in stocks less than $10
cond6=C > O; // todays close higher than open
// The following line is the trigger if all conditions satisfied
Buy=cond1 AND cond2 AND cond3 AND cond4 AND cond5 AND cond6;
//--------------------------------------------------------------------------------------------------------------------
// Here we define variables used once in the trade
ApplyStop( stopTypeLoss, stopModePercent, amount=10 );
Sell= Cross(Ref(EMA(L,180),-1),C); // close crosses below yesterdays average of the low
//-------------------------------------------------------------------------------------------------------------------
// Here we define what gets displayed on the chart
PlotShapes(Buy*shapeUpArrow,colorGreen,0,Low);
PlotShapes(Sell*shapeDownArrow,colorRed,0,High);
//-------------------------------------------------------------------------------------------------------------------
//Exploration
Filter = cond1 AND cond2 AND cond3 AND cond4 AND cond5 AND cond6;
// lists exploration results conforming to our buy criteria
AddColumn(Buy, "buy", 1.0); //
//Filter = Sell; // lists exploration results conforming to our buy criteria
//AddColumn(Sell, "sell", 1.0); //
// This section creates the data that you can plot to see how often TT2 trades
// NOTE:- Using VOLUME array so get correct number when switching to WEEKLY or MONTHLY display
AddToComposite(Buy,"~TTBuys","V");
AddToComposite(Sell,"~TTSells","V");
Buy = ExRem(Buy,Sell) ;
Sell = ExRem(Sell, Buy);
Binary = Flip(Buy , Sell);
//-----------------------------------------------------------------------------------------------------------------
//EMAs
_SECTION_BEGIN("EMA 40");
P = ParamField("Price field",-1);
Periods = Param("Periods", 40, 2, 300, 1 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorBlueGrey ), ParamStyle("Style"),styleThick );
_SECTION_END();
_SECTION_BEGIN("EMA 180");
P = ParamField("Price field",-1);
Periods = Param("Periods", 180, 2, 300, 1 );
Plot( EMA( L, Periods ), _DEFAULT_NAME(), colorOrange , ParamStyle("Style"),styleThick );
_SECTION_END();
//----------------------------------------------------------------------------------------------------------------
//Highest High Plotting
_SECTION_BEGIN("HHV Long term Entry");
HHVlongtermPeriod=Param("HHV Long termPeriod",70,1,50);
LongPeriodEntry=HHV(H,HHVLongtermPeriod);
Plot (LongperiodEntry," Highest High 70 Days ",colorRed,styleLine);
_SECTION_END();
_SECTION_BEGIN("HHV Short term Entry");
HHVshorttermPeriod=Param("HHV short term Period",10,1,50);
ShortperiodEntry=HHV(H,HHVshorttermPeriod);
Plot (ShortperiodEntry," Highest High 10 Days ",colorBlue,styleLine);
_SECTION_END();
The code appears OK
Although I use metastock.
Use the ASX 200
Infact the data base I used when designing it was the BT Margin list.
The ASX 200 is pretty close.
See how that goes.
I also note your start date is 2000 and finish 2004.
Does your results include open equity in trades still open at your close off date-- or only CLOSED trades.This could be one big reason.
Average trade length is just over a year,so there are often trades with heaps of equity still open.
I note average bars held at 5.
The code appears OK
Although I use metastock.
Use the ASX 200
Infact the data base I used when designing it was the BT Margin list.
The ASX 200 is pretty close.
See how that goes.
I also note your start date is 2000 and finish 2004.
Does your results include open equity in trades still open at your close off date-- or only CLOSED trades.This could be one big reason.
Average trade length is just over a year,so there are often trades with heaps of equity still open.
I note average bars held at 5.
"Does your results include open equity in trades still open at your close off date-- or only CLOSED trades.This could be one big reason."
I understand what you are asking but I dont know how to find that out? I have checked the backtester and it doesnt have a setting for that. Sorry not sure how to find out.
Hello and welcome to Aussie Stock Forums!
To gain full access you must register. Registration is free and takes only a few seconds to complete.
Already a member? Log in here.