PureBytes Links
Trading Reference Links
|
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 only
bo.EnterTrade(bar, sig.symbol, True, sig.Price, ps, sig.PosScore,sig.RoundLotSize);
}
}
----- Original Message -----
From: intermilan04
To: amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, August 15, 2006 11:37 PM
Subject: [amibroker] Re: Buying at open -- In Real Life
Hi Mark,
Very interesting approach. How do you limit the volume like how you
do? I am aware you can limit by % of one bar's volume, but not sure
if you could do like 1% of 50 period EMA of volume.
Regards,
intermilan04
--- In amibroker@xxxxxxxxxxxxxxx, "Mark H" <amibroker@xxx> wrote:
>
> Yes. My system buys/sells at open since I still have a day job. The
results have been very close to those of backtest.
> I think it contribute to two factors: I use IB which in most cases
can get you the exact open prices; my system limits the shares to buy
to 1% of 50 period EMA of volume.
>
> ----- Original Message -----
> From: intermilan04
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Tuesday, August 15, 2006 2:30 AM
> Subject: [amibroker] Buying at open -- In Real Life
>
>
> Hi all,
>
> I'm just curious if anyone here are buying and selling securities at
> the open with market orders, i.e. orders are placed BEFORE MARKET OPEN
> and they get executed as soon as the market opens.
>
> I have noticed that buying at the open might help you get cheap
> shares, but the reverse is also true...you might sell your shares at
> really bad bids.
>
> The reason why I'm bringing it up is, my system on Amibroker is
> designed to trade at the open. And strangely enough, my system isn't
> doing too well ever since I started using it...perhaps it's because
> I'm getting bad bids and asks by placing market orders overnight?
>
> I'm not quite sure how the first trade occurs, in theory I sell to the
> highest bidder but with low liquidity of pre-market trading, what if
> the highest bid is absurdly low?
>
> Any thoughts on this is greatly appreciated.
>
> Regards,
>
> intermilan04
>
|