indiTraders - Forum for the Active Indian Trader  

Go Back   indiTraders - Forum for the Active Indian Trader > Technical > Indicators & Systems

Indicators & Systems Compendium of Code

Composite Edge
Reply
 
Bookmark and Share LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 10-05-2010, 10:41 PM
anirudhsnewworl's Avatar
anirudhsnewworl anirudhsnewworl is offline
indiTraders VIP
 
Join Date: Jul 2009
Posts: 458
Thanks: 907
Thanked 1,080 Times in 367 Posts
anirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to all
Default Adheer

i was going through the AFL u provied on gaussian distribution and i must say really liked it.

few doubts if you could clear
1) have u tried using normalized price? with my limited research(unfortunately theoretical) i have found that normalization will really improve the efficiency of the system

2)How do you conclude which pair among universe of stocks to be selected?

i mean most of the fund managers prefer "Pearson correlation coefficient"..

while applying the same on "bank nifty and cnx nifty over past 7 weeks data" on weekly close r=0.57 which is not worth pair-trading...ain't it?
nifty banknifty
5018 9276
5278 9870
5304 9813
5262 9353
5262 9656
5361 9507


pearson r= 0.57



3)since the method is not co-integrated the results will change with change of time series for eg if i apply it on weekly charts and u using daily..wich according to your experience is optimum?

find attached a research paper which uses same method as u follow +-2 SD
Attached Files
File Type: pdf 0412018.pdf (87.5 KB, 85 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 4 Users Say Thank You to anirudhsnewworl For This Useful Post:
  #12 (permalink)  
Old 10-05-2010, 10:48 PM
anirudhsnewworl's Avatar
anirudhsnewworl anirudhsnewworl is offline
indiTraders VIP
 
Join Date: Jul 2009
Posts: 458
Thanks: 907
Thanked 1,080 Times in 367 Posts
anirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to all
Default step by step procedure to build a trading setup for paired trading

step 1)
2 identify pair across different sectors with different volatility but corelation coefficient > 0.87...
there are many ways of pairing up but what most fund managers prefer is finding Pearson coefficient....which can easily be done by MS-Excel
here is the procedure

Calculating the Pearson Product Momement Correlation Coefficient with the Excel Spreadsheet Program

To calculate the Pearson Product Moment Correlation Coefficient with the Excel Spreadsheet Program, open a new worksheet and create a table with the data that will be used to create the scatterplot. We will use the data from Table 3 - Reading and Spelling Scores for 10 Students - which may look like the following after being entered into an Excel worksheet.

Find the correlation between reading and spelling as follows:

1. Click on cell A14 and enter the following label - Pearson r =

2. Click on cell B14 and then click on the Paste Function icon

3. In the Paste Function window select Statistical under Function category:, then scroll down and select PEARSON under Function name:

4. Click OK.

5. Drag the Pearson window, which appears, so that it is not covering your Table 3 data.

6. Click and select cells B3 through B12. The Array 1 box should now show the range of cells for reading (B3:B12).

7. Select the Array 2 box by clicking in it, then click and select cells C3 through C12. The Array 2 box should now show the range of cells for spelling (C3:C12).

8. Click OK and note that -0.3611812 appears in cell B14.

9. Format the quantity in cell B14 by clicking on it and then selecting Cells... from the Format menu. Click on the Number tab and select Number under Category: Use the selection arrow to set Decimal places: at 2 and click OK.




find attached sample excel file for calculating Pearson coefficient for "BANKNIFTY AND NIFTY"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 5 Users Say Thank You to anirudhsnewworl For This Useful Post:
  #13 (permalink)  
Old 10-05-2010, 10:56 PM
anirudhsnewworl's Avatar
anirudhsnewworl anirudhsnewworl is offline
indiTraders VIP
 
Join Date: Jul 2009
Posts: 458
Thanks: 907
Thanked 1,080 Times in 367 Posts
anirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to all
Default STEP 2

USE any of the spread model namely gaussian markov chain model,gaussian probability model,rank spread model et al....one can code his own AFL if he's good with trading...
one master in this field is adheer sir one can use his gaussian probability afl

best reference book=
Ganapathy Vidyamurthy, (2004),Pairs trading: quantitative methods and
analysis, John Wiley & Sons Inc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 4 Users Say Thank You to anirudhsnewworl For This Useful Post:
  #14 (permalink)  
Old 10-05-2010, 11:11 PM
anirudhsnewworl's Avatar
anirudhsnewworl anirudhsnewworl is offline
indiTraders VIP
 
Join Date: Jul 2009
Posts: 458
Thanks: 907
Thanked 1,080 Times in 367 Posts
anirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to all
Default resources

YouTube - 08/02/08: Tom Preston: Pairs Trading 1/9

YouTube - 08/02/08: Tom Preston: Pairs Trading 3/9

YouTube - 08/02/08: Tom Preston: Pairs Trading 2/9

YouTube - 08/02/08: Tom Preston: Pairs Trading 4/9

YouTube - 08/02/08: Tom Preston: Pairs Trading 5/9

YouTube - 08/02/08: Tom Preston: Pairs Trading 6/9

YouTube - 08/02/08: Tom Preston: Pairs Trading 8/9

YouTube - 08/02/08: Tom Preston: Pairs Trading 9/9

Pairs Trading, Convergence Trading, Cointegration[[complete study material on cointegration pairing]]

+
ME if you are really interested collect 100's of research international papers on pair-trading FOR free
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 6 Users Say Thank You to anirudhsnewworl For This Useful Post:
  #15 (permalink)  
Old 15-05-2010, 02:23 PM
anirudhsnewworl's Avatar
anirudhsnewworl anirudhsnewworl is offline
indiTraders VIP
 
Join Date: Jul 2009
Posts: 458
Thanks: 907
Thanked 1,080 Times in 367 Posts
anirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to all
Default complete trade setup for pairtrading

step 1) is to check for unit root test in stock/index..this test is done check if the stock is suited for "pair trading"..for this there are many methods viz jonson Johansen’s Vector Error Correction Model,Dickey fuller test....with the test we will filter out the stocks fit for pair trading which is nothing but testing that stocks actually follow mean reversion .
i am attaching a 3 files with this post in which step by step procedure is given how do perform dickey fuller test , a spreadsheet where i have performed the above said test on nifty and bank nifty, and VBA excel file for simulating the test.
note in the file i have used single lag but with several tests it can be confirmed that optimum lag is 4(Akaike’s information criteria)...attaching research paper which suggests the same
conclusion : nifty,banknifty is fit for pairtrading
not able to upload xls file
so take it from here
http://www.4shared.com/document/JnU0...r-example.html
http://www.4shared.com/file/Ji-MtHLq...shen_test.html
http://www.4shared.com/file/UDUB9Scl/research.html
Attached Files
File Type: pdf 08_unitroottests_2pp.pdf (126.0 KB, 44 views)
File Type: pdf nifty empirical.pdf (131.5 KB, 58 views)

Last edited by anirudhsnewworl; 16-05-2010 at 02:15 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 3 Users Say Thank You to anirudhsnewworl For This Useful Post:
  #16 (permalink)  
Old 15-05-2010, 02:44 PM
anirudhsnewworl's Avatar
anirudhsnewworl anirudhsnewworl is offline
indiTraders VIP
 
Join Date: Jul 2009
Posts: 458
Thanks: 907
Thanked 1,080 Times in 367 Posts
anirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to all
Default step 2

2 check for correlation and to pair up the stock...simple corelation test can be done in excel ....values above 0.85 are considered strong
in the attached excel file i have done correlation testing ...
i have giver formatting condition as follows
SHOWS WEAk RELATION (-0.3 to +0.3)
SHOWS STRONG CORELATION (+.3 to + .7)
shows very strong relation( .7 to 1)
corelation is checked between 10 index stocks and corelation values for 3 months and 5 months are checked...and avg of 2 values will ensure long term corelation exists between them
best corelation exists between hindalco and tatasteel...
after the paring is done use the afl provied in "http://www.inditraders.com/amibroker/3168-afl-corpus.html"
statistics folder and the use is as follows
as prices move out of +,- 2 SD range..short the overbought stock(beyond +2SD wala) and long the oversold stock(-2SD wala) simutaneously

4shared.com - online file sharing and storage - download research.xlsx
^^
link for SPREADSHEET
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 4 Users Say Thank You to anirudhsnewworl For This Useful Post:
  #17 (permalink)  
Old 15-05-2010, 02:46 PM
anirudhsnewworl's Avatar
anirudhsnewworl anirudhsnewworl is offline
indiTraders VIP
 
Join Date: Jul 2009
Posts: 458
Thanks: 907
Thanked 1,080 Times in 367 Posts
anirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to all
Default admin

why is .XLSX format not supported while attaching ...no one uses 2003 office i guess world has moved to office 2010..please make necessary changes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to anirudhsnewworl For This Useful Post:
  #18 (permalink)  
Old 15-05-2010, 04:08 PM
mask's Avatar
mask mask is offline
Regulars
 
Join Date: Aug 2009
Posts: 110
Thanks: 561
Thanked 283 Times in 91 Posts
mask has a spectacular aura aboutmask has a spectacular aura aboutmask has a spectacular aura aboutmask has a spectacular aura about
Default

Originally Posted by anirudhsnewworl View Post
why is .XLSX format not supported while attaching ...no one uses 2003 office i guess world has moved to office 2010..please make necessary changes

google search for microsoft office 2007 compatibility pack...would be around 36 mb file...with that u can open and edit new version files like excel, word 2007 into old version office...
regards

Last edited by mask; 15-05-2010 at 04:11 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 15-05-2010, 04:48 PM
anirudhsnewworl's Avatar
anirudhsnewworl anirudhsnewworl is offline
indiTraders VIP
 
Join Date: Jul 2009
Posts: 458
Thanks: 907
Thanked 1,080 Times in 367 Posts
anirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to allanirudhsnewworl is a name known to all
Default

Originally Posted by mask View Post
google search for microsoft office 2007 compatibility pack...would be around 36 mb file...with that u can open and edit new version files like excel, word 2007 into old version office...
regards

mine is office 2007 u dun need ne pack to open 2003 file in 2007
i was saying while uploading in the post it allows to upload xls file not xlsx :exclaim:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to anirudhsnewworl For This Useful Post:
  #20 (permalink)  
Old 17-05-2010, 04:37 PM
oilman5 oilman5 is offline
Regulars
 
Join Date: Mar 2009
Location: navimumbai
Posts: 377
Thanks: 70
Thanked 859 Times in 334 Posts
oilman5 is just really niceoilman5 is just really niceoilman5 is just really niceoilman5 is just really niceoilman5 is just really niceoilman5 is just really niceoilman5 is just really niceoilman5 is just really niceoilman5 is just really nice
Default

Many yr back 1995, bhel-hardwar.......in the month of June ,in an open bridge tournament........on the 1st day of tournament, candidates r offered 2problems to solve..........prize 3000/- and 2nd soln giver to get 1000/-.........timeframe within 2days.
We r being in BHEL Quarter/guest house.........& mostly tried to solve them.Kanpur IIT team tried really hard,.......Present India top players of Ankeleshwaria.......and his partner really spent good time,.........novices.......were dreaming to get prize, sleeping at wee hr.Since i am with new partner 60+age, i have to mug system........so i admit to fail. After first day,........the prize money was not yet claimed, i hoped to solve it,.....Alas my partner pulled me out,..........as we r in main swing , he told me to concentrate further,.......to practice some tips......so i went back with him in an ashram where he was staying. Yes next day we played well,........sufficiently confident to win a prize...........i went back to Dehradun , highly proud, as some great name like Mr S Gupte offerred me, ........also some other businessman offered to join in professional group.
.....................Yes that was my first top winning tournament in bridge,.........but i knew now its shear coinsidence, i executed well, my partner........60 + , handled disciplined part, and we r lucky..........as most young/top callibre players r wasted their TIME .........to solve mathematical puzzle of null event.[1st problem has no soln]
I myself experimented vector modelling[being BE(MECH)] to solve,..........market price mathematically...............knowing now its big O.only KISS works in market.
Have u seen market today? Every fool can say............from last week bias , today market shall be down.........now learn the right bias..........after 11-30 ,u can see Nifty is no more falling,.........support exists there,...........now play itself in nifty futute for 25pt[1/2% of nifty] or strong candidate of today........like abb...........to make a good return,...................this is actual trading.
Theoriticians r ...........just to be avoided in trading.
......................................
sorry for reality in trade.learn first what works in market and in reality possible by u

Last edited by oilman5; 17-05-2010 at 05:12 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 7 Users Say Thank You to oilman5 For This Useful Post:
Reply

indiTraders - Forum for the Active Indian Trader > Technical > Indicators & Systems


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Composite Edge

All times are GMT +5.5. The time now is 01:29 PM.


vBulletin Copyright by vBulletin

Content Relevant URLs by vBSEO 3.3.2