![]()
Dear readers and followers, the year is coming to an end. I want to take this opportunity and wish all readers and fellow traders a merry Christmas and a happy new year.
For me it’s been a year of growth. Besides of continuously improving my systems and learning, I’ve setup this blog. The blog helped me to focus my thinking and precisely articulate my thoughts. During the last couple of weeks and months many new readers joined the blog.
. .
So let me briefly list the most popular posts:
I do plan to continue this blog in the year to come. However, I would like to give you an opportunity to impact the direction of this blog and it’s content. Please tell me what’s important to you and what you want me to write about in upcoming posts? Please add your desired posts in the comment section bellow.
.
Thank you very much.
Frank






Hi Frank.
I am not sure what to study about Amibroker systems, because the trading systems are a matter of inspiration most times.
So, I like when you explain trading ideas with detailed results, from where we can evolve them or reaserch.
The rotational ones are interesting, I haven’t used them yet..
In my case, I also like to see complex Amibroker code, for there are so many capabilities that I don’t use in Ami, and so few AFL books, that studying good examples is fantastic.
Anyway all your articles are inspiring..
Merry Christmas!
Hi again
I’ve remembered an idea I’ve got time ago, and for me is difficult to write the code:
Obtaining a high CAR system with good quality numbers is very difficult. But obtaining low CARs, high RAR’s and low exposition is not so difficult.
So a very simple idea is to mix 2-3 different systems in one meta-system. The 3 systems ‘compete’ for the same capital. I mean, all the systems use the same money, and because all them have low exposition, they should open positions many times.
The three ‘mixed’ systems should have then high CAR and good quality numbers.
The problem for me is that mixing 2 or 3 different systems in just one AFL program and obtaining the backtest report without errors, is quite complex, and I haven’t got it yet..
Perhaps this is an idea to develop..
Frank,
Fantastic contributions and keep up the good work! I also would love to see work toward meta system processes, combining separate systems together. Also, any work on “automation” of multiple runs in Amibroker would be very interesting.
Hi Frank,
first of all congratulation for all posts along 2010 which have been very inspiring.
About suggestions for the future: I would agree that analysing system allocation in a portfolio of systems is a very interesting and hot topic going forward.
Merry Xmas and happy new year,
Paolo
thanks for awesome blog.
few things which will help your blog reader like me –
1. kelly optimization or simmilar stuff in amibroker – latest css topic on intermarket analysis and how to code and improve it in amibroker.
2. i am seeing some errors in amibroker, i dont know if you have noticed this when i run backtest even though the score is highest it doesnt select the correct symbol for trade
//#include ;
#include ;
//#include ;
//SetCustomBacktestProc(“C:\Program Files\AmiBroker\Formulas\Systems\cbt_midlevel.afl”,True);
SetOption(“CommissionAmount”,0.00);
SetOption(“InitialEquity”,1000);
SetTradeDelays(0,0,0,0);
//SetTradeDelays(1,1,1,1);
EnableRotationalTrading() ;
//SetBacktestMode( backtestRotational);
//SetBacktestMode( backtestRegularRaw );
SetOption(“MaxOpenLong”,1);
SetOption(“MaxOpenPositions”,1);
SetPositionSize( 100, spsPercentOfEquity);
SetOption(“HoldMinDays”,1 );
//IndexMember = NDX100member(Name(),DateNum());
IndexMember = True;
//MAFilter2 = (Foreign(“SPY”,”C”) > MA(Foreign(“SPY”,”C”),200)) *(ROC(Foreign(“SPY”,”C”),200) > 0) ;
MAFilter2 = (Foreign(“SPY”,”C”) > MA(Foreign(“SPY”,”C”),200)) ;// OR (Foreign(“SPY”,”C”) > MA(Foreign(“SPY”,”C”),20)) ;
//MAFilter2 = ROC(Foreign(“SPY”,”C”),200) > 0 ;
//MAFilter2 = MA(C,50) > MA(C,200) ;
RestorePriceArrays();
SetForeign(“^VIX”);
Vix_value=12;
TimeFrameSet(inWeekly);
RSI14_vix = RSI(Vix_value);
TimeFrameRestore();
RSI14_vix = TimeFrameExpand( RSI14_vix , inWeekly );
MAFilter =RSI14_vix MA(idx,20) OR idx > MA(idx,200);
//MArketOk = idx > MA(idx,200);
//exec = IIf(Name()==”AAPL”,1,0); //hard coded in order to improve performance, need to to this only once per bar for all stocks
EXEC = IIf(Status(“stocknum”)==1,1,0); // instead of Name()==”AAPL”
for( i = 0;( ( sym = StrExtract( List, i ) ) != “”) ; i++ )
{
Maxitems = i+1;
}
Maxitems = Maxitems+1;
if (EXEC[1]==1)
{
for( i = 0;( ( sym = StrExtract( List, i ) ) != “”) ; i++ )
{
//Member = NDX100member(sym,DateNum() );
SetForeign(sym);
//sym_v1 = IIf(member,TSI(),0);
//sym_v2 = IIf(member,abs(ROC(Close,200)),0);
sym_v1 = 1;//TSI();
sym_v2 = abs(ROC(C,21)) + abs(ROC(C,126)) + abs(ROC(C,60)) ;
//sym_v2 = abs(ROC(C,200)) ;
sym_v3 = 1;
sym_v4 = 1;
sym_v5 = 1;
RestorePriceArrays();
//StaticVarSet(“IDXMember”+(i+1),member);
StaticVarSet(“RANK1″+(i+1),sym_v1);
StaticVarSet(“RANK2″+(i+1),sym_v2);
StaticVarSet(“RANK3″+(i+1),sym_v3);
StaticVarSet(“RANK4″+(i+1),sym_v4);
StaticVarSet(“RANK5″+(i+1),sym_v5);
}
}
for( i = 1; i Rank1 AND idx AND rank2!=0,1,0);
//Rank2_Score = Rank2_Score + IIf( Rank2_bench > Rank2 AND idx AND rank2!=0,1,0);
Rank1_Score = Rank1_Score + IIf( Rank1_bench Rank2 AND rank2!=0 ,1,0);
Rank3_Score = Rank3_Score + IIf( Rank3_bench > Rank3 AND idx AND rank2!=0,1,0);
Rank4_Score = Rank4_Score + IIf( Rank4_bench > Rank4 AND idx AND rank2!=0,1,0);
Rank5_Score = Rank5_Score + IIf( Rank5_bench > Rank5 AND idx AND rank2!=0,1,0);
}
ComboRank = IIf(indexmember,Rank1_score + Rank2_Score ,0);
//ComboRank = IIf(indexmember,Rank2_Score ,0);
Score = IIf((MAFilter2 AND MAFilter AND (ComboRank >0)),ComboRank,0);
Condition1 = DayOfWeek()==5;//(DateNum()>=1010101 AND DayOfWeek()==5);// OR DateNum()>=1100901;
//PositionSize = -100;
//PositionScore= IIf(Condition1,score,scoreNoRotate);
PositionScore = IIf(Score 6);//Condition1 ;
//Filter = DateNum() == EndValue(DateNum());
AddColumn(Rank1_bench, “Rank1_Value”, 1.2);
AddColumn(Rank1_score, “Rank1_Score”, 1);
AddColumn(Rank2_bench, “Rank2_Value”, 1.2);
AddColumn(Maxitems, “Maxitems”, 1);
AddColumn(Rank2_score, “Rank2_Score”, 1);
//AddColumn(Rank3_bench, “Rank3_Value”, 1.2);
//AddColumn(Rank3_score, “Rank3_Score”, 1);
//AddColumn(Rank4_bench, “Rank4_Value”, 1.2);
//AddColumn(Rank4_score, “Rank4_Score”, 1);
//AddColumn(Rank5_bench, “Rank5_Value”, 1.2);
AddColumn(score, “Score”, 1);
AddColumn(C, “Close”, 1);
AddColumn(V, “Volume”, 1);
AddColumn(ComboRank, “ComboRank”, 1);
AddColumn(PositionScore, “PositionScore”, 1);
AddColumn(Condition1, “Condition1″, 1);
SetSortColumns(-2,-8);
Frank,
You’ve done great work here and many appreciate it. I would love to see any ideas you have about trending systems. Most of what I trade are mean reversion systems. These tend to be a bit weak during times of low volatility. Trending systems ought to be better during these times, but I haven’t been able to come up with a decent approach. Any thoughts on that would be welcome; as well as what metric we might use to decide when to switch approaches. This blend could be quite powerful.
Thanks,
Bill
Frank,
can you help me explain why we need this peice of code (rank2!=0)
in below statement. I don’t find any reason for this code, but if i take it out it doesn’t work, i tried to set the explore and see what i get but its not very revealing..its become a head scratcher for me.
Rank1_bench > Rank1 AND rank2!=0
Hi Bill,
let me check this after christmas.
Frank
Hi Frank, stumbled across your blog while investigating mean reversion trading, impressed and appreciate the effort, a lot to absorb.
Potential discussion point: maybe VIX performance and low volume environments like now, any correlation to SPX ?
My suggestion for possible future topics is to explore the pros and cons of adaptive indicators and systems.
Hello Frank,
first of all, thank you for thist great blog.
I’m interested in researching the dfferences between backtest-trades, trades on IB-simulation-account and trades with real money. There are several possible sources for such differences: getting triggered with a limit order or not, the slippage you get for a MOO or a MOC order in different market conditions and for different stocks, stock-splittings, margin restrictions and the order of triggering, pyramidising or not, data errors in databases, and probably some more.
The goal of this research is to better adjust the backtesting parameters in order to get more realistic results.
Happy new year,
ChartRider
Hi Frank,
I would like to read more about your work with stat arb…
thanks in advance,
predator
Both auto-adaptation at the intra- (i.e indicators) and inter-strategy (i.e. strategy allocation) level are hot and interesting topics.
Paolo
How about discussing some ideas on trading in liquid stocks?
Hi Frank,
first of all I would like to thank you for presenting your very good work here! Its refreshing that there is no bullshit talk, no sentences like : “I heard that this or that might work”, “You need to do that in order to be successful” Its nice to see someone to back up his thoughts about the market with self collected data.
Now lets get to your question. One question I am dealing with atm is how to split portfolio money between different systems? I would realy love to read something about your way of splitting the money!