[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: market position



PureBytes Links

Trading Reference Links

Yuki,
The Nikkei2003 system was quite successful. [+65% since 06/2003]
The following exploration gives the decision Day(). 

// Nikkei 2003 timing
SYM="^N225";
STARTBUY=DateNum()==1030131;
STARTSELL=DateNum()==1030217;
startIP=DateNum()==1030530;in=DateNum()>=1030530;
x=17;
EVENT=BarsSince(startIP)%x==0;
Plot(50,"",1,1);
shape=33+2*(Cum(event)%10);
Color=colorIndigo;space=-40;
PlotShapes(shape*EVENT,color,0,Graph0,space);
//2nd
event1=Cum(event)%10==0 AND Ref(Cum(event)%10,-1)!=0;
Counter1=Cum(event1);
shape1 = IIf(counter1==0,shapeNone,shapeDigit0 + 2 * ( Counter1%
10 )) ;
PlotShapes(event*shape1,color,0,Graph0,space+10);
Plot(0,"",1,1);
G=0;
BFR0=15;BFR1=40;SFR0=20;SFR1=60;
for(BuyFREQ=BFR0;BuyFREQ<BFR1;BuyFREQ++)
{
for(SellFREQ=SFR0;SellFREQ<SFR1;SellFREQ++)
{
Buy=BarsSince(STARTBuy)%Buyfreq ==0;
Sell=BarsSince(STARTSell)%Sellfreq==0;
Short=Sell;Cover=Buy;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem
(Short,Cover);Cover=ExRem(Cover,Short);
e1=Equity(1,0);E11=ValueWhen(EVENT,E1);G=IIf(G>E11,G,E11);
}}
BFpass=0;SFpass=0;
for(BuyFREQ=BFR0;BuyFREQ<BFR1;BuyFREQ++)
{
for(SellFREQ=SFR0;SellFREQ<SFR1;SellFREQ++)
{
Buy=BarsSince(STARTBuy)%Buyfreq ==0;
Sell=BarsSince(STARTSell)%Sellfreq==0;
Short=Sell;Cover=Buy;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem
(Short,Cover);Cover=ExRem(Cover,Short);
e1=Equity(1,0);
E11=ValueWhen(EVENT,E1);
BF1=IIf(E11==G,BuyFREQ,0);BFpass=BFpass+BF1;
SF1=IIf(E11==G,SellFREQ,0);SFpass=SFpass+SF1;
G=IIf(E11==G,0,G);
}}
Plot(BFPASS,"\nBFpass",colorBlack,8);Plot
(SFPASS,"SFpass",colorBlue,8);
// the trading system
Cb=in*BarsSince(STARTBuy)%BFpass ==0;
Cs=in*BarsSince(STARTSell)%SFpass==0;
Cb=ExRem(Cb,Cs);Cs=ExRem(Cs,Cb);
Buy=in*BarsSince(STARTBuy)%BFpass ==0;
Sell=in*BarsSince(STARTSell)%SFpass==0;
Short=Sell;Cover=Buy;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem
(Short,Cover);Cover=ExRem(Cover,Short);
e1=Equity(1,0);Plot(e1,"Equity",colorBrightGreen,styleOwnScale);
Filter=Buy OR Sell;
AddColumn(Day(),"",1.0);

Results:
Ticker,Date/Time,Column 0,
^N225,9/6/2003,9
^N225,4/7/2003,4
^N225,8/8/2003,8
^N225,26/8/2003,26
^N225,5/9/2003,5
^N225,20/10/2003,20
^N225,20/11/2003,20
^N225,15/1/2004,15
^N225,6/2/2004,6
^N225,5/4/2004,5
^N225,19/4/2004,19
^N225,28/6/2004,28

Although many dates fall in your Prime area, the 15 or 20 decisions 
were quite sucessful.
It would be interesting to increase position for the Prime area, but 
I do not know how to code it.
Dimitris Tsokakis

--- In amibroker@xxxxxxxxxxxxxxx, Yuki Taga <yukitaga@xxxx> wrote:
> Hi DIMITRIS,
> 
> Sunday, July 4, 2004, 6:42:35 PM, you wrote:
> 
> DT> Yuki, It seems you want the first and the last trading bars of a
> DT> month. If 29 is Sat, 30 is Sun and 31 is a holiday then Day()>29
> DT> would make no sense...the interesting bars would be 26, 27 and
> DT> 28. Dimitris Tsokakis
> 
> Basically correct.  I looked at it two ways: day of the month, and
> trading day of the month.  Day of the month has statistical
> significance.  Trading day of the month had much less significance.
> In fact, it had almost zero compared to day of the month.  So, I'll
> increase position size on any 30th or 31st, including the 27th or
> higher in February, as well as any trading day up to but not past 
the
> 4th of any month. If it sets up like you outlined above, that's is
> simply the way it sets up that particular month; next month will be
> different. As you know, I'm a patient girl, which I think is a big
> reason I'm successful. Different months will have different numbers
> of 'PrimeA' days of course.  But in my back testing there is no
> denying the statistical significance. It *is* significant enough to
> bump up the risk a bit.  Not to go crazy, but to take on a little 
bit
> more risk.
> 
> I am planning to take a deeper look at situations like you outlined
> above, however.  I suspect, but cannot say with any authority yet,
> that what happens in these cases is that the money moves after the
> 1st.  Traders tend to shy away from long holiday periods anyway, so
> that might explain why I find little or no statistical significance
> for the 27th or 28th, etc., in situations like that. Testing for
> those situations where there are no trading days at the end of the
> month (no PrimeA days, anyway), but only at the beginning, might be
> revealing. Or it might not.  ^_-
> 
> I am still playing with a PrimeB, which might include another day or
> two, particularly the 5th and/or 6th where there are two weekend 
days
> (or holidays) in 1 through 4 (as is the case this month).  If I
> decide to do that, I'll shrink position size a bit on non Prime
> periods, and have yet a third position size for PrimeB, somewhere
> between non-Prime and PrimeA.  But I'm still looking into this.
> 
> This is all somewhat odd, because I just read some data on the US
> regarding mutual fund shenanigans, and it pretty much said you are a
> fool if you buy around the end of the month, because of mutual fund
> window dressing.  I've more or less always been aware of this, but 
my
> holding period is much shorter, so maybe I take advantage of this
> game if it's played in Japan, and I'm sure it is, although maybe not
> to such a large extent.  Interestingly, the data I was reading said
> that regular buying on the 28th added something like 4 percent a 
year
> to overall returns over many years.  Again though, they are talking
> about long holding periods.  I cannot reproduce that with my holding
> periods.
> 
> Yuki



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/