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

[amibroker] Pair trading



PureBytes Links

Trading Reference Links




We have seen the top10 stocks which perform better with 
D-ratio5.
AMAT, CPWR, CSCO, JNPR, MXIM, NTAP, PSFT, QCOM, TMPW and 
VRTS.
Let us put these stocks to, say, WatchList3 and let us name it 
"top 10 D-ratio" .
Let us use, for the simplicity, D1=40.
Apply to : use filter : top 10 D-ratio
Range : from : 3/1/2000 to 16/2/2003 
and Optimize with 
 
NUM=Optimize(<FONT 
size=2>"NUM",2<FONT 
size=2>,0,<FONT 
size=2>9,1<FONT face=Verdana 
size=2>);
NUM1=Optimize(<FONT 
size=2>"NUM1",9<FONT 
size=2>,0,<FONT 
size=2>9,1<FONT face=Verdana 
size=2>);
N=<FONT face=Verdana 
size=2>
WriteIf(NUM==0<FONT 
size=2>,"AMAT"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM==1<FONT 
size=2>,"CPWR"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM==2<FONT 
size=2>,"CSCO"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM==3<FONT 
size=2>,"JNPR"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM==4<FONT 
size=2>,"MXIM"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM==5<FONT 
size=2>,"NTAP"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM==6<FONT 
size=2>,"PSFT"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM==7<FONT 
size=2>,"QCOM"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM==8<FONT 
size=2>,"TMPW",<FONT face=Verdana 
size=2>"VRTS"<FONT 
face=Verdana size=2>
))))))))) ;
N1=<FONT face=Verdana 
size=2>
WriteIf(NUM1==0<FONT 
size=2>,"AMAT"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM1==1<FONT 
size=2>,"CPWR"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM1==2<FONT 
size=2>,"CSCO"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM1==3<FONT 
size=2>,"JNPR"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM1==4<FONT 
size=2>,"MXIM"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM1==5<FONT 
size=2>,"NTAP"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM1==6<FONT 
size=2>,"PSFT"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM1==7<FONT 
size=2>,"QCOM"<FONT 
face="Times New Roman">,<FONT 
face="Times New Roman">
WriteIf(NUM1==8<FONT 
size=2>,"TMPW",<FONT face=Verdana 
size=2>"VRTS"<FONT 
face=Verdana size=2>
))))))))) ;<FONT 
face="Times New Roman">
H=Foreign(N,<FONT 
size=2>"H");L=Foreign<FONT 
size=2>(N,"L");<FONT face=Verdana 
size=2>// The Data used to produce the 
signal<FONT 
face="Times New Roman">
Dratio=1000<FONT 
size=2>*(H-L)/(H+L);RRR=DEMA<FONT 
size=2>(Dratio,5);RRRR=<FONT 
size=2>DEMA(RRR,10<FONT 
face=Verdana size=2>);<FONT 
face="Times New Roman">
D1=40;<FONT face=Verdana 
size=2><FONT 
face="Times New Roman">//Optimize("D1",46,30,50,1);<FONT 
face=Verdana size=2>
<FONT 
face="Times New Roman">F1=RRRR>=D1;F2=RRRR<=D1;<FONT 
face="Times New Roman">
x=Name()==N1;<FONT 
face=Verdana size=2>// The stock you 
trade
Sell=X*F2;Buy=X*F1;Buy=ExRem<FONT 
size=2>(Buy,Sell);Sell=ExRem<FONT face=Verdana 
size=2>(Sell,Buy);<FONT 
face="Times New Roman">
Short=Sell;Cover=Buy;Short=ExRem<FONT 
size=2>(Short,Cover);Cover=ExRem<FONT face=Verdana 
size=2>(Cover,Short);
 
The ideal pair would exist when [NUM, NUM1] is the best among [NUM, X] 
and the [NUM1, NUM] is the best among  [NUM1, Y]
[8, 6] and [6,8] is an example : [6, 8] is the best among [6, X] and [8, 6] 
is one of the best among [8, Y]
PSFT and TMPW act like a pair for D-ratio5 system. Use PSFT data to trade 
TMPW and, vice versa, use TMPW data to trade PSFT.
[note that you should multiply by 10 the results of optimization, since the 
total % Net Profit is over the whole Watch List]
Results of the type [X, X] present the self-contained stocks, you will get 
good results if you trade them with their own data.
We do not see many [X, X] examples in the upper part of the Optimization 
result list and this is the main value of the transcendental use of data 
!!
It is the human mind that produces this argument : "Trade a stock with its 
own data "
The transcendental research PROOVES the opposite : You will always get 
better results if you "borrow" some other OHLCV.
 
A self-contained stock is nothing but an exception !!!
 
Check it out...
Dimitris Tsokakis
 






Yahoo! Groups Sponsor


  ADVERTISEMENT  









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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



Attachment:
pairs.gif

Attachment: Description: "Description: GIF image"