PureBytes Links
Trading Reference Links
|
Herbert,
Watch out !!
This is a Nikkei study as it is written in the title of the thread
and in the beginning of the code !!
Due to the fact
STARTSELL=DateNum()==1030217;
Feb17 was not a trading bar for US stocks !!
So, if you just paste it to a US stock, Sell will not start at all.
Now, the modus operandi is "simple" and already described.
a. After the beginning of this year, buy at the first significant
trough.
b. Sell at the first significant peak.
c. Then buy every x1 bars after the initial buy, sell every x2 bars
after the initial sell.
d. Let the first 6 months for the "education" of the system.
e. Apply for the next 6 months with the appropriate "corrections"
[every 15-20 bars], automatically offerred by the code.
I hope it is clear.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, Herbert Elstein <herty@xxxx> wrote:
> Hi Dimitris,
>
> Would you mind explaining in simple English what you have here. I
mean what is the modus operandi of the system, the formula is above
my understanding. Why shouldn't it apply to any stock, with buy only
trades, for me? Is the formula as is applicable, etc.
>
> All the best and TIA
>
> Herbert
> ----- Original Message -----
> From: Dimitris Tsokakis
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Thursday, December 18, 2003 10:05 AM
> Subject: [amibroker] Fw: Artificial Intelligence, an
introduction, ^N225 2003
>
>
> Some details:
> The system is Short since Dec2.
> It will cover and buy again in 7 bars.
> The last 4 trades are profitable.
> Dec16 was the 9th inspection day, the [25,28] combination is
again the timing preference for the next 17 bars.
> [25,28] is the top combination for a 5th period, it is quite
successful.
> [33,28] is ready to replace [25,28] , if the rhythm needs some
change.
> [An intelligent system should always take care of the
succession...]
> Spy the future of the system with the simple
> SYM="^N225";in=DateNum()>=1030530;
> STARTBUY=DateNum()==1030131;
> STARTSELL=DateNum()==1030217;
> startIP=DateNum()==1030530;
> BuyFREQ=Optimize("b",33,10,40,1);
> SellFREQ=Optimize("s",28,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);
>
> [33,28] and its harmonic hybrid [16,28] are the probable
successors of the long-time champion [25,28]
>
> Dimitris Tsokakis
> ----- Original Message -----
> From: Dimitris Tsokakis
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Wednesday, December 17, 2003 3:17 PM
> Subject: Artificial Intelligence, an introduction, ^N225 2003
>
>
> Yuki wrote at
http://groups.yahoo.com/group/amibroker/message/54931
> "...There are a lot of people who missed the move this year,
and..."
>
> What could we do not to miss the move ? Here is the elementary AI
proposal:
>
> The first significant ^N225 trough was on Jan31, 2003 and the
very next significant peak was on Feb17.
> Suppose we follow this pattern and then buy every x1 days after
the first buy and sell every x2 days after the first sell.
> By the end of the first 6 months we try to learn the rhythm of
the market and trade it for the next 6 months.
> The initial rhythm may need corrections as the market changes,
inspections every 15-20 days are necessary.
> The results are interesting:
> There were 3 main rhythm combinations [x1,x2], the [29,24] for 34
days, the [26,33] for the next 34 days and, finally,
> a potential combination [25,28] was detected around mid September
and it is valid untill now.
> Another important issue : The system "understood" around mid July
that x1 should be < x2.
> It means buys should be more frequent than sells, a
characteristic of bullish markets
> [the more you delay a Sell, the more part of the bullish trend
you enjoy...]
> The black [29,24] equity line was a nice solution up to the end
of July, the white [26,33] up to the middle of August.
> The red [25,28] was the most tenacious all year long.
> The trading parameters are
>
> Settings
>
> Initial Equity: 10000 Periodicity/Positions: Daily/Long
Short
> Commissions: 0.50 % Annual interest rate: 0.00%
> Range: 30/5/2003 00:00:00 - 17/12/2003 Apply to: Current
Symbol
> Margin requirement: 100 Futures mode: No
> Def. round lot size: 0 Def. Tick Size 0
> Drawdowns based on: Open prices
> Long trades
> Buy price: Open Sell price: Open
> Buy delay: 1 Sell delay: 1
> Short trades
> Short price: Open Cover price: Open
> Short delay: 1 Cover delay: 1
> Stops
> Maximum loss: disabled Profit target: disabled
> Value: 30.00 Value: 20.00
> Exit at stop? yes Exit at stop? no
>
> Trailing stop: disabled
> Value: 5.00
> Exit at stop? no
>
> Formula
>
>
> SYM="^N225";in=DateNum()>=1030530;
> STARTBUY=DateNum()==1030131;
> STARTSELL=DateNum()==1030217;
> startIP=DateNum()==1030530;
> x=17;
> // A Hi-pass filter
> EVENT=BarsSince(startIP)%x==0;
> k0=20;Plot(k0,"k0",Cum(1)%2,1);s0=60;
> shape=33+2*(Cum(event)%10);
> PlotShapes(shape*EVENT,colorRed);
> Plot(0,"",1,1);Plot(100,"",1,1);Slevel=80;
> 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);
> }}
>
> Buy=BarsSince(STARTBuy)%bfpass ==0;Sell=BarsSince(STARTSell)%
sfpass==0;Short=Sell;Cover=Buy;
> Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem
(Short,Cover);Cover=ExRem(Cover,Short);
> Overall performance summary
>
> Total net profit: 4079.56 Total commissions paid: 895.39
> Return on account: 40.80 % Open position gain/loss -
34.86
> Buy&Hold profit: 2121.88 Bars (avg. days) in test: 137
(201)
> Buy&Hold % return: 21.22% System to Buy&Hold index:
92.26%
>
> Annual system % return: 86.13% Annual B&H % return:
41.83%
>
> System drawdown: -339.32 B&H drawdown: 0.00
> Max. system drawdown: -961.08 B&H max. drawdown: -1793.58
> Max. system % drawdown: -8.11% B&H max. % drawdown: -
13.39%
> Max. trade drawdown: -961.08
> Max. trade % drawdown: -8.11%
> Trade drawdown: -484.71
>
> Total number of trades: 8 Percent profitable: 75.0%
> Number winning trades: 6 Number losing trades: 2
> Profit of winners: 4696.27 Loss of losers: -719.72
> Total # of bars in winners: 117 Total # of bars in
losers: 15
> Commissions paid in winners: 677.37 Commissions paid in
losers: 218.01
>
> Largest winning trade: 1390.45 Largest losing trade: -
380.40
> # of bars in largest winner: 23 # bars in largest loser:
9
> Commission paid in largest winner: 110.42 Commission paid
in largest loser: 117.32
>
> Average winning trade: 782.71 Average losing trade: -
359.86
> Avg. # of bars in winners: 19.5 Avg. # bars in losers:
7.5
> Avg. commission paid in winner: 112.90 Avg. commission
paid in loser: 109.01
> Max consec. winners: 3 Max consec. losers: 1
>
> Bars out of the market: 2 Interest earned: 0.00
>
> Exposure: 98.5% Risk adjusted ann. return: 87.41%
> Ratio avg win/avg loss: 2.18 Avg. trade (win & loss):
497.07
> Profit factor: 6.53
>
>
> Performance for ^N225
>
> Total net profit: 4079.56 Total commissions paid: 895.39
> Return on account: 40.80 % Open position gain/loss -
34.86
> Buy&Hold profit: 2121.88 Bars (days) in test: 137 (201)
> Buy&Hold % return: 21.22% System to Buy&Hold index:
92.26%
>
> Annual system % return: 86.13% Annual B&H % return:
41.83%
>
> System drawdown: -339.32 B&H drawdown: 0.00
> Max. system drawdown: -961.08 B&H max. drawdown: -1793.58
> Max. system % drawdown: -8.11% B&H max. % drawdown: -
13.39%
> Max. trade drawdown: -961.08
> Max. trade % drawdown: -8.11%
> Trade drawdown: -484.71
>
> Total number of trades: 8 Percent profitable: 75.0%
> Number winning trades: 6 Number losing trades: 2
> Profit of winners: 4696.27 Loss of losers: -719.72
> Total # of bars in winners: 117 Total # of bars in
losers: 15
> Commissions paid in winners: 677.37 Commissions paid in
losers: 218.01
>
> Largest winning trade: 1390.45 Largest losing trade: -
380.40
> # of bars in largest winner: 23 # bars in largest loser:
9
> Commission paid in largest winner: 110.42 Commission paid
in largest loser: 117.32
>
> Average winning trade: 782.71 Average losing trade: -
359.86
> Avg. # of bars in winners: 19.5 Avg. # bars in losers:
7.5
> Avg. commission paid in winner: 112.90 Avg. commission
paid in loser: 109.01
> Max consec. winners: 3 Max consec. losers: 1
>
> Bars out of the market: 2 Interest earned: 0.00
>
> Exposure: 98.5% Risk adjusted ann. return: 87.41%
> Ratio avg win/avg loss: 2.18 Avg. trade (win & loss):
497.07
> Profit factor: 6.53
>
>
>
>
> For Indicator builder see the timing coefficients variations and
the more important equity lines with the code
>
>
> // ^N225 timing for 2003
> STARTBUY=DateNum()==1030131;// first trough
> STARTSELL=DateNum()==1030217;// first peak
> startIP=DateNum()==1030530;// inspections and trading start
> x=17;
> // The Hi-pass filter
> EVENT=BarsSince(startIP)%x==0;
> k0=10;Plot(k0,"k0",Cum(1)%2,1);
> s0=60;
> shape=33+2*(Cum(event)%10);
> PlotShapes(shape*EVENT,colorIndigo);
> Plot(0,"",1,1);
> Plot(50,"",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 3 main equity lines
> BuyFREQ=29;SellFREQ=24;
> 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);
> Plot(E1,"["+WriteVal(Buyfreq,1.0)+","+WriteVal(Sellfreq,1.0)
+"]",colorblack,8+styleLeftAxisScale);
>
> BuyFREQ=26;SellFREQ=33;
> 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);
> Plot(E1,"["+WriteVal(Buyfreq,1.0)+","+WriteVal(Sellfreq,1.0)
+"]",colorwhite,8+styleLeftAxisScale);
>
> 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);
> e1=Equity(1,0);
> Plot(E1,"["+WriteVal(Buyfreq,1.0)+","+WriteVal(Sellfreq,1.0)
+"]",colorred,8+styleLeftAxisScale);
>
> Dimitris Tsokakis
>
>
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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
> ADVERTISEMENT
>
>
>
>
>
> --------------------------------------------------------------------
----------
> Yahoo! Groups Links
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/amibroker/
>
> b.. To unsubscribe from this group, send an email to:
> amibroker-unsubscribe@xxxxxxxxxxxxxxx
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
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 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/
|