' Allocates the Basis and Sentiments to either the IRS's for the 3m Curve and the 6m Curve. ' AR 16 Nov 06 Sub TestForm_OnLoad() Dim IO Dim BidSwapSplice Dim AskSwapSplice Dim RowNo Dim Basis Dim i Dim j Dim k Dim s Set IO = GetObject("","Cubes.IScriptCubeIO") BidSwapSplice = IO.GetInputCubeCell(0,0).GetValueDouble() AskSwapSplice = IO.GetInputCubeCell(1,0).GetValueDouble() RowNo=IO.GetInputCubeRows(3) ReDim BasisPlusSentiment(RowNo) ReDim Basis(RowNo) ReDim Sentiment(RowNo) ReDim SentimentMinusBasis(RowNo) ReDim ThreeMBasisBid(RowNo) ReDim ThreeMBasisAsk(RowNo) ReDim SixMBasisBid(RowNo) ReDim SixMBasisAsk(RowNo) For i=0 to RowNo-1 BasisPlusSentiment(i) = IO.GetInputCubeCell(2,i).GetValueDouble() Basis(i) = IO.GetInputCubeCell(3,i).GetValueDouble() Sentiment(i)=BasisPlusSentiment(i) - Basis(i) SentimentMinusBasis(i)=Sentiment(i) - Basis(i) Next Select Case BidSwapSplice Case 0 For j= 0 to RowNo-1 ThreeMBasisBid(j) = SentimentMinusBasis(j) SixMBasisBid(j) = Sentiment(j) Next Case 1 For j= 0 to 1 ThreeMBasisBid(j) = Sentiment(j) SixMBasisBid(j) = BasisPlusSentiment(j) Next For k= 2 to RowNo-1 ThreeMBasisBid(k) = SentimentMinusBasis(k) SixMBasisBid(k) = Sentiment(k) Next Case 2 For j= 0 to 3 ThreeMBasisBid(j) = Sentiment(j) SixMBasisBid(j) = BasisPlusSentiment(j) Next For k= 4 to RowNo-1 ThreeMBasisBid(k) = SentimentMinusBasis(k) SixMBasisBid(k) = Sentiment(k) Next Case 3 For j= 0 to 5 ThreeMBasisBid(j) = Sentiment(j) SixMBasisBid(j) = BasisPlusSentiment(j) Next For k= 6 to RowNo-1 ThreeMBasisBid(k) = SentimentMinusBasis(k) SixMBasisBid(k) = Sentiment(k) Next Case 4 For j= 0 to 7 ThreeMBasisBid(j) = Sentiment(j) SixMBasisBid(j) = BasisPlusSentiment(j) Next For k= 8 to RowNo-1 ThreeMBasisBid(k) = SentimentMinusBasis(k) SixMBasisBid(k) = Sentiment(k) Next End Select Select Case AskSwapSplice Case 0 For j= 0 to RowNo-1 ThreeMBasisAsk(j) = SentimentMinusBasis(j) SixMBasisAsk(j) = Sentiment(j) Next Case 1 For j= 0 to 1 ThreeMBasisAsk(j) = Sentiment(j) SixMBasisAsk(j) = BasisPlusSentiment(j) Next For k= 2 to RowNo-1 ThreeMBasisAsk(k) = SentimentMinusBasis(k) SixMBasisAsk(k) = Sentiment(k) Next Case 2 For j= 0 to 3 ThreeMBasisAsk(j) = Sentiment(j) SixMBasisAsk(j) = BasisPlusSentiment(j) Next For k= 4 to RowNo-1 ThreeMBasisAsk(k) = SentimentMinusBasis(k) SixMBasisAsk(k) = Sentiment(k) Next Case 3 For j= 0 to 5 ThreeMBasisAsk(j) = Sentiment(j) SixMBasisAsk(j) = BasisPlusSentiment(j) Next For k= 6 to RowNo-1 ThreeMBasisAsk(k) = SentimentMinusBasis(k) SixMBasisAsk(k) = Sentiment(k) Next Case 4 For j= 0 to 7 ThreeMBasisAsk(j) = Sentiment(j) SixMBasisAsk(j) = BasisPlusSentiment(j) Next For k= 8 to RowNo-1 ThreeMBasisAsk(k) = SentimentMinusBasis(k) SixMBasisAsk(k) = Sentiment(k) Next End Select For s=0 to RowNo-1 IO.GetOutputCubeCell(0,s).SetValueDouble(ThreeMBasisBid(s)) IO.GetOutputCubeCell(1,s).SetValueDouble(ThreeMBasisAsk(s)) IO.GetOutputCubeCell(2,s).SetValueDouble(SixMBasisBid(s)) IO.GetOutputCubeCell(3,s).SetValueDouble(SixMBasisAsk(s)) Next End Sub Sub TestForm_OnUnLoad() End Sub