Assistance Required for coding Pairs Trading AFL

pankajpari

RSITradeMaster
#52
I have been trading equities since the last 4 years through various techniques. I have been using Pairs trading techniques and have devised and modified several self made trading models. What you need to understand is the theory behind the concept. You have to partly Discard Fama's efficient market hypothesis. Maybe i ll expand upon the filters to be used and my reasons for not trading this model through charts but through some numbers and intution. Human touch and understanding is equally important here.
Hi Big Short, waiting for your post.....
 
#53
Hi Pankaipari,

Can you please provide here AFL for pair trading between ICICIBANK and PNB? The reason for asking a sample AFL here is that I'm pretty much new to such technical language and not in a position to make updates in your original AFL provided in your earlier threads.

So, please consider my request and provide sample AFL with scrip names & other data into it.

Thanks in advance.

Nehal Suthar
 

pankajpari

RSITradeMaster
#54
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.
 
#56
Pankajpan,
I'm not sure I received your reply but thanks anyway. It would be most garcious if you could send me a copy of your updated code to my email address:

"[email protected]" as I am extremely interested in pursuing this Pairs concept.

Thanks Dick
 

mangup

Well-Known Member
#58
Hi PankajPari,

I have gone through the thread from beginning. I am finding it to be slightly more technical. Also i am not very well conversed with Ami. In learning phase.

I found u to be in discovering & experimenting on pair trading in options.

Can u please explain me with an example/chart, how u identify a pair & trade it?

Can u explore automatically the pair to trade through Ami?

I am finding this method to be interesting to learn.
 

pankajpari

RSITradeMaster
#59
Hi mangup,
Apologies for the late revert.

Pls PM me your mail id / cell number and shall explain the same using team viewer.

As regards using 'exploration', not sure how this can be done. The code for exploration will need to be tweaked to include the foreign symbol, which I am unable to do. But I am sure this can be easily be done by experts in Ami.
 
#60
Hi Pankaj,
I wish to trade with your pair trading afl.
some questions:
1) how to find best suitable pair?(on daily chart)
2) I have found that many signals on the chart.when std dev is increased signals get reduced.which std dev is best?
3) how long should be in trade? means when to exit?
4) are you trading with this?
 

Similar threads