Ok here we go. (The first 3 Steps invlve the necessary groundwork while the 4th step is the coding & execution)
STEP I : Seting IsIndex property for base Index
In symbols pane Select NIFTY (or whatever symbol name you have for the NIFTY index)
Goto Symbol->Information menu item and scroll down to Composites in the Information dialog box that appears. Set IsIndex property to 'yes'.
STEP II : Seting base Index for Composites
Open Categories window using Symbol -> Categories menu item.
Select NSE (or whatever mkt name you have) in Markets tab
In 'Base indexes for - Composites' combo enter NIFTY (or whatever symbol name you have for the NIFTY index)
STEP III : Calculating Adv/Decl composites
Choose "Symbol ->Calculate composites" menu item to open the Composites recalculation window
Check Number of advancing/declining issues. In 'Apply to' Select 'All quotes'and 'This market'->Select NSE (or whatever mkt name you have).
Click Calculate (this will take some time, you can however choose to use just the past 3/6/12 mths data. Enter the date range/no. of bars accordingly)
STEP IV: Coding & Executing
The Exploration code :
x = MA(AdvIssues(),10)/MA(DecIssues(),10);
Buy = x > 0.75 AND Cross(RSI(8),30);
Sell = Cross(0.5,x) OR Cross(65,RSI(8));
Filter = (Buy OR Sell); //AND IsIndex();*
AddColumn(x, "Adv/Decl");
AddColumn(RSI(8), "RSI");
AddColumn( IIf( Buy, Asc("B"), Asc("S")), "Signal", formatChar );
Open Formula Editor using Analysis->Formula Editor menu, type the formula and choose Tools->Send to Automatic Analysis menu in Formula editor
To base your exploration on the most recent quote you should choose "n last quotations" and "n=1"
-------------
* If you include the IsIndex() flag and get no output for n=1, increase the value to 10,20,30. However this for testing only.
MISCELLANY :
You can include other tradable indices (like CNX IT, BANK NIFTY, CNX NIFTY Jr, CNX 100) in your Exploration by setting their IsIndex property to True as in Step I.
If you're using the ASCII Importer you can Calculate composites automatically while importing data by checking the 'calculate Composites' option in the Import dialog.
Check the EXREM function to remove excessive (consecutive buys or sells) signals.
Regards,
Kalyan.