No stock on the Australian Stock Exchange trades 500,000 shares per day - that's your problem. Why do you need both of those filters anyway? I'd just use the turnover filter and ditch the volume filter.
Are you sure about that.......
// Filter Part 1
AORDClose = Foreign("^AORD","C");
AORDUp=AORDClose>EMA(AORDClose,200);
AORDDown=AORDClose<EMA(AORDClose,200);
AORDFilter = ParamToggle("AORD Filter","On|Off",1);
if(AORDFilter == True)
for( i=1;i<BarCount; i++ )
if(AORDUp[i] == True)
Lpds = 75;
else {
Lpds = 30;
}
else {
Lpds = 75;
}
//-----------------------------------------------------------------------------------------------------------------------
Hpds=Param("hpds",20 ,6 , 30 ,1 );
Range1=Optimize("range1",55,50,150,1);
bi = BarIndex();
myCandle = bi == LastValue(bi) - Lpds;
Color = IIf( myCandle, colorBlue, colorBlack);
fillcolor = IIf( C > O , colorWhite, IIf( myCandle, colorBlue, colorLightGrey));
SetBarFillColor(fillcolor );
Plot(Close, "C", Color, styleCandle);
DonchianUpper =HHV(Ref(H,-1),Hpds);
DonchianLower = LLV(Ref(L,-1),Lpds);
DonchianMiddle = (DonchianUpper+DonchianLower)/2;
//---------------------------------------------------------------------------------------------------------------------------------
// Filter part 2
AORDClose = Foreign("^AORD","C");
AORDUp=AORDClose>EMA(AORDClose,200);
AORDDown=AORDClose<EMA(AORDClose,200);
Cond1= Close > DonchianUpper AND Close > EMA( Close , range1 );
Cond2=EMA((Close*Volume),21)>1000000;
Cond3=AORDUP;
AORDFilter = ParamToggle("AORD Filter","No|Yes",1);
if(AORDFilter == True)
for( i=1;i<BarCount; i++ )
if(AORDUp[i] == True)
Buy=Cond1 AND Cond2;
else {
Buy=Cond1 AND Cond2 AND Cond3;
}
else {
Buy=Cond1 AND Cond2 AND Cond3;
}
Sell= Close < DonchianLower;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Plot(DonchianUpper,"DU",colorBlue,styleLine);
Plot(DonchianMiddle,"DM",colorLightGrey,styleLine);
Plot(DonchianLower,"DL",colorRed,styleLine);
PlotShapes(Buy*shapeUpArrow,colorGreen,0,Low);
PlotShapes(Sell*shapeDownArrow,colorRed,0,High);
//----------------------------------------------------------------------------------------------------------------------------------
//AORD Trend Ribbon 200EMA
_SECTION_BEGIN("trending ribbon");
myClose = Foreign("^AORD","C");
uptrend=myClose>EMA(myClose,200);
downtrend=myClose<EMA(myClose,200);
Plot( 2, /* defines the height of the ribbon in percent of pane width*/"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, colorDarkGrey )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
// Filter Part 1
AORDClose = Foreign("^AORD","C");
AORDUp=AORDClose>EMA(AORDClose,200);
AORDDown=AORDClose<EMA(AORDClose,200);
AORDFilter = ParamToggle("AORD Filter","On|Off",1);
if(AORDFilter == True)
for( i=1;i<BarCount; i++ )
if(AORDUp[i] == True)
Lpds [ i ] = 75;
else {
Lpds [ i ] = 30;
}
else {
Lpds [ i ] = 75;
}
//-----------------------------------------------------------------------------------------------------------------------
Hpds=Param("hpds",20 ,6 , 30 ,1 );
Range1=Optimize("range1",55,50,150,1);
bi = BarIndex();
myCandle = bi == LastValue(bi) - Lpds;
Color = IIf( myCandle, colorBlue, colorBlack);
fillcolor = IIf( C > O , colorWhite, IIf( myCandle, colorBlue, colorLightGrey));
SetBarFillColor(fillcolor );
Plot(Close, "C", Color, styleCandle);
DonchianUpper =HHV(Ref(H,-1),Hpds);
DonchianLower = LLV(Ref(L,-1),Lpds);
DonchianMiddle = (DonchianUpper+DonchianLower)/2;
//---------------------------------------------------------------------------------------------------------------------------------
// Filter part 2
AORDClose = Foreign("^AORD","C");
AORDUp=AORDClose>EMA(AORDClose,200);
AORDDown=AORDClose<EMA(AORDClose,200);
Cond1= Close > DonchianUpper AND Close > EMA( Close , range1 );
Cond2=EMA((Close*Volume),21)>1000000;
Cond3=AORDUP;
AORDFilter = ParamToggle("AORD Filter","No|Yes",1);
if(AORDFilter == True)
for( i=1;i<BarCount; i++ )
if(AORDUp[i] == True)
Buy=Cond1 AND Cond2;
else {
Buy=Cond1 AND Cond2 AND Cond3;
}
else {
Buy=Cond1 AND Cond2 AND Cond3;
}
Sell= Close < DonchianLower;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Plot(DonchianUpper,"DU",colorBlue,styleLine);
Plot(DonchianMiddle,"DM",colorLightGrey,styleLine);
Plot(DonchianLower,"DL",colorRed,styleLine);
PlotShapes(Buy*shapeUpArrow,colorGreen,0,Low);
PlotShapes(Sell*shapeDownArrow,colorRed,0,High);
//----------------------------------------------------------------------------------------------------------------------------------
//AORD Trend Ribbon 200EMA
_SECTION_BEGIN("trending ribbon");
myClose = Foreign("^AORD","C");
uptrend=myClose>EMA(myClose,200);
downtrend=myClose<EMA(myClose,200);
Plot( 2, /* defines the height of the ribbon in percent of pane width*/"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, colorDarkGrey )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
// Filter Part 1
AORDClose = Foreign("^AORD","C");
AORDUp=AORDClose>EMA(AORDClose,200);
AORDDown=AORDClose<EMA(AORDClose,200);
AORDFilter = ParamToggle("AORD Filter","On|Off",1);
Lpds=0;
for( i=1;i<BarCount; i++ )
if(AORDFilter == True)
Lpds [ i ] = 75;
else {
Lpds [ i ] = 30;
}
if (AORDFilter == False) {
Lpds [ i ] = 75;
}
//-----------------------------------------------------------------------------------------------------------------------
Hpds=Param("hpds",20 ,6 , 30 ,1 );
Range1=Optimize("range1",55,50,150,1);
bi = BarIndex();
myCandle = bi == LastValue(bi) - Lpds;
Color = IIf( myCandle, colorBlue, colorBlack);
fillcolor = IIf( C > O , colorWhite, IIf( myCandle, colorBlue, colorLightGrey));
SetBarFillColor(fillcolor );
Plot(Close, "C", Color, styleCandle);
DonchianUpper =HHV(Ref(H,-1),Hpds);
DonchianLower = LLV(Ref(L,-1),Lpds);
DonchianMiddle = (DonchianUpper+DonchianLower)/2;
//---------------------------------------------------------------------------------------------------------------------------------
// Filter part 2
AORDClose = Foreign("^AORD","C");
AORDUp=AORDClose>EMA(AORDClose,200);
AORDDown=AORDClose<EMA(AORDClose,200);
Cond1= Close > DonchianUpper AND Close > EMA( Close , range1 );
Cond2=EMA((Close*Volume),21)>1000000;
Cond3=AORDUP;
AORDFilter = ParamToggle("AORD Filter","No|Yes",1);
if(AORDFilter == True)
for( i=1;i<BarCount; i++ )
if(AORDUp[i] == True)
Buy=Cond1 AND Cond2;
else {
Buy=Cond1 AND Cond2 AND Cond3;
}
else {
Buy=Cond1 AND Cond2 AND Cond3;
}
Sell= Close < DonchianLower;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Plot(DonchianUpper,"DU",colorBlue,styleLine);
Plot(DonchianMiddle,"DM",colorLightGrey,styleLine);
Plot(DonchianLower,"DL",colorRed,styleLine);
PlotShapes(Buy*shapeUpArrow,colorGreen,0,Low);
PlotShapes(Sell*shapeDownArrow,colorRed,0,High);
//----------------------------------------------------------------------------------------------------------------------------------
//AORD Trend Ribbon 200EMA
_SECTION_BEGIN("trending ribbon");
myClose = Foreign("^AORD","C");
uptrend=myClose>EMA(myClose,200);
downtrend=myClose<EMA(myClose,200);
Plot( 2, /* defines the height of the ribbon in percent of pane width*/"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, colorDarkGrey )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
Would anyone be able to inform me as to how I change the x and y axes of the Equity Curve in the Report section in AB?
Thanks,
Troy
What do you mean by changing x and y axes?
y -> date axis??
Say I just want to backtest a period of 1990 - 2010. My graph shows from 1920 till 2012 or something ridiculous.
And with the equity curve can it be changed to log rather than linear scale?
Why don't you simply use 'From-To' option in AA window?
I.e. apply the Porfolio Equity AFL on a chart. Open parameters dialog and go to 'Axes&Grid' and click 'Type' to 'Logarithmic'
Do you mind posting your code and tested symbols and AA settings (bt settings window > save)? What's your AB version number?
And with the equity curve can it be changed to log rather than linear scale?
SetChartOptions( 0, chartShowDates | chartLogarithmic );
Initial capital 100000.00
Ending capital 128722.76
Net Profit 28722.76
Net Profit % 28.72 %
Exposure % 15.08 %
Net Risk Adjusted Return % 190.50 %
Annual Return % 2.74 %
Risk Adjusted Return % 18.18 %
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() );
// techtrader v2 amibroker version
// here we define buy conditions and name each one as a variable
PositionSize = -10; // always invest only 10% of the current Equity
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);
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);
_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("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();
_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();
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
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
[/CODE]
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?