|
Limit shares by % of one bar's volume is one of the
worst practices in backtesting.
I am always a bit puzzled by why everybody is
concerned about "looking into the future" but few people pay attention to
this practice.
It is "looking into the future" in terms of volume!
When you place an order in the morning, do you know today's volume?
And position sizing has great impact on system
performance.
Anyway, to use 1% EMA(V,50) of today as limit for
tomorrow's entry, you may need to use CBT to do backtest.
Here is what I do: (normal position size is 10% of
equity)
......
SetPositionSize (EMA(V,50) * 0.01 * BuyPrice, spsValue );...... if ( Status("action") == actionPortfolio ){ bo = GetBacktesterObject();.......... for ( sig=bo.GetFirstSignal(bar); sig; sig=bo.GetNextSignal(bar)){ // Only one position per symbol if (sig.isEntry() AND sig.Price != -1 AND IsNull( bo.FindOpenPos( sig.Symbol ))){ // sig.PosSize is passed from Phase I. It is %1 of EMA(V, 50).ps = Min(sig.PosSize, bo.Equity * 0.10); // long onlybo.EnterTrade(bar, sig.symbol, True, sig.Price, ps, sig.PosScore,sig.RoundLotSize); } } __._,_.___ 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
__,_._,___ |
- Re: [amibroker] Re: Buying at open -- In Real Life Mark H
