
for !k = 1 to 100 step +1
  for !i = 1 to 7
      for !j=1 to 7
         if !j>!i then

    group gr_{!i}_{!j} ser0{!i} ser0{!j}  'Creates a group of prices to check for cointegration 
    freeze(coint_{!i}_{!j}) gr_{!i}_{!j}.coint(c,cvsize=0.05) 'Creates a copy (freezes) of coint table

	table result  ' To create a table and pull the result of all cointegration result into it
setcolwidth(result,1,20) 'To change the width of the columns
setcolwidth(result,2,45)
setcolwidth(result,3,15)
	
	result(!k,1)=coint_{!i}_{!j}(5,1) 'needed results
	result(!k,2)=coint_{!i}_{!j}(16,1)
	result(!k,3)=coint_{!i}_{!j}(13,5)

       endif 
     next
   next
next

