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

[amibroker] Re: Institutional Sponsorship



PureBytes Links

Trading Reference Links

Yuki,
The new code will place the arrows the very same bar they appear and 
is independent of AA settings [delay +1].

 // 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);
PlotShapes(shape*EVENT,colorIndigo);
Plot(0,"",1,1);
G=0;
for(BuyFREQ=10;BuyFREQ<40;BuyFREQ++)
{
for(SellFREQ=10;SellFREQ<40;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=10;BuyFREQ<40;BuyFREQ++)
{
for(SellFREQ=10;SellFREQ<40;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);
/*PlotShapes(shapeUpTriangle*Buy,colorBrightGreen);
PlotShapes(shapeDownTriangle*Sell,colorRed);
PlotShapes(shapeUpArrow*Cover,colorDarkGreen);
PlotShapes(shapeDownArrow*Short,colorDarkRed);*/
PlotShapes(shapeUpTriangle*Cb,colorBrightGreen);
PlotShapes(shapeDownTriangle*Cs,colorRed);
PlotShapes(shapeUpArrow*Cb,colorDarkGreen);
PlotShapes(shapeDownArrow*Cs,colorDarkRed);
Plot( 2, "Ribbon",IIf( BarsSince(Buy)>BarsSince(Sell), colorRed, 
colorGreen), styleArea|styleNoLabel, -1, 100 );
GraphXSpace=5;
Title=sym+", BFpass="+WriteVal(BFpass,1.0)+", SFpass="+WriteVal
(SFpass,1.0)+", Equity="+WriteVal(e1);

A few comments now :
25/28 is still the system preference.
33/28 was not that lucky. It was covered by the shadow of 25/28 for a 
long period.
A new star is rising [18/37] and may be the next selection, since it 
is ascending the last bars.
It is hard to be No 1, especially if your structure is bearish and 
the environment is bullish.
The next IP [15 bars later] will decide ...
I bet on the new 18/37, it buys every 18 bars and sells every 37 bars 
and matches better the bullish market
[if Nikkei will search for new highs, which is probable enough for me]
We shall see...
You may see the top combinations with

 // Nikkei 2003 timing Optimization
SYM="^N225";
STARTBUY=DateNum()==1030131;
STARTSELL=DateNum()==1030217;
BuyFREQ=Optimize("bf",10,10,40,1);
SellFREQ=Optimize("sf",10,10,40,1);
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);

and plot the respective equities with

// Nikkei 2003 timing
SYM="^N225";
STARTBUY=DateNum()==1030131;
STARTSELL=DateNum()==1030217;
BuyFREQ=25;
SellFREQ=28;
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);
Plot(Equity(),WriteVal(BuyFREQ,1.0)+"/"+WriteVal(SellFREQ,1.0),1,1);

BuyFREQ=18;
SellFREQ=37;
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);
Plot(Equity(),WriteVal(BuyFREQ,1.0)+"/"+WriteVal(SellFREQ,1.0),2,1);

BuyFREQ=33;
SellFREQ=28;
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);
Plot(Equity(),WriteVal(BuyFREQ,1.0)+"/"+WriteVal(SellFREQ,1.0),4,1);

BuyFREQ=16;
SellFREQ=28;
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);
Plot(Equity(),WriteVal(BuyFREQ,1.0)+"/"+WriteVal(SellFREQ,1.0),5,1);

Another interesting point : We are in 2004. We should discover the 
first significant peak/trough of the year [??] to build up the Nikkei 
2004 timing code, then give it 5months and begin the new IP for the 
new year.

Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, Yuki Taga <yukitaga@xxxx> wrote:
> Hi DIMITRIS,
> 
> Friday, January 16, 2004, 8:54:56 PM, you wrote:
> 
> DT> Yuki, Jan15 was an inspection bar [the 10th] BFpass is again 25,
> DT> SFpass is again 28 . The system will use these parameters for 
the
> DT> next 17 bars, untill the next inspection. Jan15 was [by
> DT> coincidence] a Sell/Short bar. Since the AA settings are at +1
> DT> Open, the arrow will appear one day later. Would it be 
convinient
> DT> to change the code and see the arrows the same day [or a warning
> DT> signal "tomorrow will be a Buy bar"]? Since the code buys every
> DT> 25 bars, the buy bar  is known many bars ago.  I may add a line
> DT> "Sell in XX bars" or "Buy in XX bars" or both "Buy in XX bars,
> DT> Sell in YY bars". What would you prefer ?
> 
> Code for both would be nice if not too much of a problem.  
Thanks. :)
> 
> Yuki


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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/