Sector rotation

trader21

Active Member
#11
Thank Raunak Sir for sharing the list.

Sandeep, we do not require exactly the same as depicted in figure. Sectors do not strictly lead/lag a business cycle as shown. Once you are done with the setup, you'll need our own studies to find our prominent properties of sector rotation as applicable to Indian market.
 

SwingKing

Well-Known Member
#12
Thank Raunak Sir for sharing the list.

Sandeep, we do not require exactly the same as depicted in figure. Sectors do not strictly lead/lag a business cycle as shown. Once you are done with the setup, you'll need our own studies to find our prominent properties of sector rotation as applicable to Indian market.
Trader21,

When we create composite indices based on sectors/industries, we have to run the afl everyday for updation of those indices. Have you figured out a way where the indices get updated automatically? If so, then let me know.

Tc
 

jagankris

Well-Known Member
#13
Dear Mates,

PLS find below the words of Mr.Karthik Marar regarding sector wise AMI db.

We require 2 Amibroker files, One text file containing the industry details for the stocks and finally one afl to load the data into Amibroker. Following are the files

1. Broker.sectors - Ami file
2. Broker.Industries - Ami File
3. Stockindustry.txt - text file containg the industry details for the stocks
4. loaddata.afl - Afl for lading the sector and Industry data.

Following is the procedure

1,Backup file c:\Program Files\Amibroker\data\Broker.Workspace ( or d:\... wherever you AB is loaded)

2. Delete Broker.Workspace

(Or you can just rename the existing Broker.Workspace into something convenient to remember)

3. Backup and Delete broker.industries and broker.sectors from
c:\program files\Amibroker.
(Or just rename as mentioned before)

4. Copy the files new broker.sectors and broker.industries file to this dir.

5. Copy LoadData.afl into c:\programfiles\Amibroker\formulas\custom ( or d:\... wherever you AB is loaded)

6. Modify LoadData.afl file to point to where the StockIndustry.txt file. Is located. The Default location is the root directory of D:\. If you are apprehensive in changing the Loaddata.afl , just save the txt file in the root directory in partition D.

7. Now open Amibroker.

8. By default, all the stocks will be in the 1st industry, Agro - Others. Move them to Industry 255 using menu item Symbol -> Organize assignments..

9. Open LoadData.afl for analysis. In the Analysis window, choose the following
Apply to: All stocks
Range : Last 200 quotes.

And then run the scan. This may take a few minutes depending on your computer speed.

10. Once the Scan is complete, check it your sector and Industry allocation.

The necessary files enclosed.

Please do let us know if you face any problem..

warm regards

karthik

**********************************************************

Rename sectorindustry to stockindustry then try.

Thanks,
JK
 
Last edited:

jagankris

Well-Known Member
#14
Sir,
Plase suggest me how to analyse sector rotation and stock picking on relative strength analysis that is top down analysis of stock and sectors.
Thank you.
Sandeep,Raunak Bhai,Experts,

What is

1.Top down approach ?
2.Bottom Up approach ?

I was thinking Top/Down analysis is based on company fundamentals like
EPS,PE,BV,PEG etc

Does RS Comparison also comes under Top Down approach.

Thanks,
JK
 

rsingh2005

Well-Known Member
#16
Hi JK
I am new to Amibroker, & tried to follow the step suggested in the post, the AFL is showing following error , for your information I am using Amibroker 5.3
f = fso_OpenTextFile( filename, ForReading);
Error So.File not found source: Microsoft jscript runtime error.
Also bit confused about this step
6. Modify LoadData.afl file to point to where the StockIndustry.txt file. Is located. The Default location is the root directory of D:\. If you are apprehensive in changing the Loaddata.afl , just save the txt file in the root directory in partition D.
I don’t have any partition ,so all the file in C drive only…… what I have done I just pasted the stockIndustry.txt in Data file in Amibroker……. Not very sure I was right or so.
Please guide how to fix this issue.
Regards
Rajesh
 

1sandeepgupta

Well-Known Member
#17
Sandeep,Raunak Bhai,Experts,

What is

1.Top down approach ?
2.Bottom Up approach ?

I was thinking Top/Down analysis is based on company fundamentals like
EPS,PE,BV,PEG etc

Does RS Comparison also comes under Top Down approach.

Thanks,
JK
Dear sir,
In the top down analysis the relative strength of sectors is compared w.r.t. market indicator say nifty or sensex and the sectors with high RS are found and then the stocks are compared w.r.t. sector's index or composite, the stocks with high RS are selected and are bought.
I bottom up analysis the stocks are directly compared w.r.t. market index say nifty or sensex and stocks with high RS are found and bought.
Thanks.
Sandeep Gupta.
 

trader21

Active Member
#18
Sandeep,Raunak Bhai,Experts,

What is

1.Top down approach ?
2.Bottom Up approach ?

I was thinking Top/Down analysis is based on company fundamentals like
EPS,PE,BV,PEG etc

Does RS Comparison also comes under Top Down approach.
Hello Jagankris,

Please have a look at this for comprehensive analysis: http://blog.thetradersforum.net/components-of-stock-analysis

Now to answer your question- In top-down approach, we start from the bigger picture, and narrow down towards a particular stock, stepwise.

In the context of this thread, you can start from comparing a sector with sensex, and then comparing the stock with its sector. Then you go to that stock's fundamentals; and finally to charts for timing your investment/long-term trading decisions.

For bottom-up analysis we do vice-versa.

The whole process may look complicated, but let me assure you it is simple. We just go forward step-wise from broad market analysis to a stock in particular.

This method is very standard followed by professional world-wide.

Cheers.
 

trader21

Active Member
#19
Trader21,

When we create composite indices based on sectors/industries, we have to run the afl everyday for updation of those indices. Have you figured out a way where the indices get updated automatically? If so, then let me know.

Tc
Yes Raunak, I have a solution for that, though I do not trade in Indian stocks.

Since this is a group activity, I'm just waiting if someone comes with a better idea/code that I have in my mind.

regards.
 

1sandeepgupta

Well-Known Member
#20
I have an idea to calculate composite of each sector as below.The afl is as below

//Choose market NSE for Automatic Analysis, it will return nothing but update sector's composite indexes in sector 23.
if(SectorID() == 0)

{

sym="~" + "Automotive";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}

if(SectorID() == 1)

{

sym = "~" + "Banking & Financial Services";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 2)

{

sym = "~" + "Consumer Durables";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 3)

{

sym = "~" + "Cement and Construction";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 4)

{

sym = "~" + "Consumer Non-durables";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 5)

{

sym = "~" + "Chemicals";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 6)

{

sym = "~" + "Conglomer";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 7)

{

sym = "~" + "Engineering & Capital Goods";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 8)

{

sym = "~" + "Food & Beverages";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 9)

{

sym = "~" + "Information Technology";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 10)

{

sym = "~" + "Manufacturing";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 11)

{

sym = "~" + "Media and Entertainment";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 12)

{

sym = "~" + "Metals & Mining";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 13)

{

sym = "~" + "Oil & Gas";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 14)

{

sym = "~" + "Pharmaceu";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 15)

{

sym = "~" + "Real Estate";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 16)

{

sym = "~" + "Services";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 17)

{

sym = "~" + "Telecommunication";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 18)

{

sym = "~" + "Tobacco";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}
if(SectorID() == 19)

{

sym = "~" + "Utilities";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}

if(SectorID() == 20)

{

sym = "~" + "Miscellaneous";

AddToComposite( L, sym,"L");

AddToComposite( O, sym,"O");

AddToComposite( H, sym,"H");

AddToComposite( C, sym,"C");

AddToComposite( V, sym, "V");

}

Buy=Sell=Short=Cover=0;

Filter=1;
This the rough idea please modify it.
 

Similar threads