# R language no-arbitrage interval model: forward arbitrage and reverse arbitrage times, yield analysis Huatai-Pineberry 300ETF visualization

The arbitrage trading of stock index futures helps stock index futures realize its price discovery and risk avoidance functions. Therefore, improving the efficiency of arbitrage trading is of great significance for playing the role of stock index futures in economic development.

This article helps clients to conduct research on futures spot arbitrage. In the research, the data of futures and its spot index are mainly used as samples, which truly restores the market and improves the accuracy of the research.

# Statistical Arbitrage Strategies

Bondarenko (2003) believed that the statistical arbitrage strategy refers to the investment strategy with zero investment cost, but its expected return is positive and the conditional expected return is non-negative; he also pointed out that the traditional definition of arbitrage is too strict and has little meaning in actual operation . Vidyamurthy (2004) believes that statistical arbitrage is based on the idea of ​​relative pricing, similar assets should have similar prices, so the price difference should be maintained at an equilibrium level; if the price difference becomes larger, it is considered that arbitrage opportunities will arise. Cointegration theory was first proposed by Engle & Granger (1987>, Wahab & Lashgari (1993), Lien & Luo (1993), Tse (1995) found that the cointegration relationship is a very important relationship between futures prices and spot prices. Burgess (1999) conducted an empirical study on the British FTSE 100 index futures with a statistical arbitrage model based on cointegration, and achieved good results.

# Arbitrage-free interval model:

upper limit

lower limit

Parameter meaning:

Data value:

## 1. Take 10 trading days, and use Huatai-Pineberry 30OETF for the spot, and make an image like this

```rs=0.028
r1=0.056
d=0.022842
TE=0.001373
Mf=0.1
Cs1=0.02*0.01
Fs1= 0.0173*0.01
Cs2= 0.3698*0.01
Fs2= 0.0265*0.01
Cs3= 0.3698*0.01
Fs3 =0.0265*0.01```
copy

Futures data:

```head(data)

##Date Opening price (yuan) Highest price (yuan) Lowest price (yuan) Closing price (yuan) Turnover (millions)
## 1 40484.40    2515.82    2517.14    2509.18    2511.86     10352.92
## 2 40484.40    2512.48    2521.34    2512.06    2521.34      6220.21
## 3 40484.41    2521.41    2522.15    2514.64    2514.74      6700.37
## 4 40484.41    2514.57    2514.57    2511.49    2513.30      4455.17
## 5 40484.41    2513.39    2515.53    2513.31    2514.45      3821.64
## 6 40484.42    2514.35    2519.64    2514.23    2519.64      4778.68
## 1 1353244240
## 2  842527307
## 3  874920739
## 4  593051008
## 5  488534018
## 6  717302833```
copy

# no-arbitrage interval model

```#upper limit
t=1
T=t+16
S=data\$`Closing price(Yuan)`
upp=S[t]*((Css+Cfb+TE)*exp(rs-d)*(T-t)+(1+Csb+TE)*exp(r1*(T-t))-exp(d*(T-t)))/(1+Mf-(Mf+Cfs)*exp(r1*(T-t)))

#lower limit

lower=S[t]*(exp(d*(T-t)-(2+Csb-Cfs+TE)*exp(rs-d)*(T-t)+(1-Css-TE)*exp(rs*(T-t)) ))/(1-Mf+(Mf+Cfb)*exp(rs*(T-t)))```
copy

Take 10 trading days for research

```for(t in 1:(nrow(data))){
#upper limit
T=t+13.575
S=data\$`Closing price(Yuan)`
((Css+Cfb+TE)*exp(rs-d)*(T-t)+(1+Csb+TE)*exp(r1*(T-t))-exp(d*(T-t)))/

#lower limit
T=t+0.506
(exp(d*(T-t)-(2+Csb-Cfs+TE)*exp(rs-d)*(T-t)+(1-Css-TE)*exp(rs*(T-t))))```
copy

# statistical results

```stragedy=result\$"market price" >=result\$"No arbitrage upper limit"
stragedy[stragedy== "TRUE"]="positive arbitrage"
index=result\$"market price" <=result\$"The lower bound of the no-arbitrage interval"
stragedy[index== "TRUE"]="reverse arbitrage"
stragedy[stragedy== "FALSE"]="0"```
copy

Count the number of positive arbitrage and reverse arbitrage opportunities and the rate of return.

## 2. Take 18 trading days for research, and change the parameters of deposit and loan interest rates. Draw the graph. Count the number of forward arbitrage and reverse arbitrage opportunities and the rate of return.

```#parameter value

rs=0.0255
r1=0.056

#no-arbitrage interval model

#upper limit
t=1
T=t+16
S=data\$`Closing price(Yuan)`
upp=S[t]*((Css+Cfb+TE)*exp(rs-d)*(T-t)+(1+Csb+TE)*exp(r1*(T-t))-exp(d*```
copy

## 3. Take 9 trading days in June for research, and change the parameters of deposit and loan interest rates. Draw the graph. Count the number of forward arbitrage and reverse arbitrage opportunities and the rate of return.

```lower=numeric(0)
for(t in 1:(nrow(data))){

#upper limit
T=t+11.875
S=data\$`Closing price(Yuan)`
((Css+Cfb+TE)*exp(rs-d)*(T-t)+(1+Csb+TE)*exp(r1*(T-t))-exp(d*(T-t)))/```
copy

## 4. In November, after 9 trading days, the parameters of deposit and loan interest rates will be changed. Draw a graph and count the number of positive arbitrage and reverse arbitrage opportunities and the rate of return.

Table: Arbitrage parameter changes

```#parameter value

rs=0.013
r1=0.0435
d=0.02177
Mf=0.42
Fs1= 0.245*0.01
Cfb=0.2715*0.01
Cfs=0.2715*0.01

#no-arbitrage interval model

#upper limit
t=1
T=t+16
S=data\$`Closing price(Yuan)````
copy
`table(stragedy)`
copy

Tags: Visualization

Posted by phphunger on Fri, 24 Mar 2023 06:11:03 +0530