Hi Nehal,
We don't need to code the name of the scrips or the indices in the AFL. Its a very simple process.....
(i) Open a New Blank Chart and then Double Click on the Pairs Trading AFL so that the Chart opens in AmiBroker.
(ii) In the pair mentioned by you, ICICI Bank is the 'High Priced Scrip', while PNB is the 'Low Priced Scrip'.
(iii) The 'Low Priced Scrip' should be selected using the graphic menu => "Type or Select a Symbol" option under the Main Menu (File, Edit, View, etc.).
(iv) In order to choose the 'High Priced Scrip', right click on the Pairs Trading Chart and select "Parameters", then replace the 'Enter High Priced Scrip Here' with ICICI Bank.
(v) Kindly note that the name should be entered as per the format specified by your datafeed provider. For ex. Globaldatafeeds uses the format ICICIBANK-I for the current month futures contract, while it is ICICIBANK-II for the next month futures contract. Some other datafeed provider may be providing the format as ICICIBANK-FU or ICICIBANK_F1.
(vi) Once you have entered the 'High Priced Scrip', click OK and the chart can now be used for monitoring Pairs.
Kindly note that this AFL is for academic purpose only and is meant only for monitoring the direction of pairs. Do not use this AFL for trading purpose unless you are fully aware of how to trade pairs and its consequences. Pls note that Pairs Trading also involves Risk and if not traded properly, it can lead to huge losses. However, if you do decide to use it for Trading, the Author(s) of this AFL will not be responsible for losses incurred, if any.
All the very best. Do reply if you have any further queries.