In [1]:

```
import pandas as pd
import numpy as np
import seaborn
%matplotlib inline
from IPython.display import Image
from IPython.core.display import HTML
```

In [2]:

```
file = 'ExperimentFullResults_noPercentage.csv'
df = pd.read_csv(file)
```

In [3]:

```
df[df.TotalTrades == 0].shape[0]
```

Out[3]:

In [4]:

```
df = df[df.TotalTrades != 0]
```

In [5]:

```
df.describe()
```

Out[5]:

In [6]:

```
Image(url="http://i.imgur.com/zcN9XSU.png")
```

Out[6]:

In [7]:

```
Image(url='http://i.imgur.com/eidGdcp.png')
```

Out[7]:

In [8]:

```
Image(url='http://i.imgur.com/i37YEZa.png')
```

Out[8]:

In [9]:

```
Image(url='http://i.imgur.com/FefKZJS.png')
```

Out[9]:

Finally the main question!

In [10]:

```
Image(url='http://i.imgur.com/lEPT2kU.png')
```

Out[10]:

At first sight, this plot shows a better performance of FXCM relative to Oanda.

Now, let's try to figure out why FXCM has that second smaller peak.

In [11]:

```
Image(url='http://i.imgur.com/bcO00pa.png')
```

Out[11]:

I used Annual SD in this projection because it helps us to separate the FXCM observations from the density second peak. The points shape are defined by PairstoTrade, and is clear that the FXCM observations to the right are mostly by runs where only the pairs with the biggest and the lowest excess returns were traded.

In [12]:

```
Image(url='http://i.imgur.com/idX7TqI.png')
```

Out[12]:

This plot shows:

- The mean (the dark blue vertical line)
- Border values for the standard deviation of the mean. The blue highlighted area is the entire standard deviation of the mean.
- The median (yellow vertical line). The thin blue line represents the area between the first (25%) and the third (75%) quantile, while the thin dotted line represents the entire range of values (from the lowest to the highest value in the data set for the selected parameter).

Here we can have a measure of the difference in Sharpe ratio because of the Broker selection. We already know that FXCM has, in average, a better performance. Here is clear that the difference is small if the means are compared; if we compare the medians, the difference is even smaller.

Finally, lets make some simple statistical tests in order to know if those small differences are significance.

In [13]:

```
from scipy.stats import ttest_ind, ttest_rel
fxcm = df[df['Broker']=='fxcm']
oanda = df[df['Broker']=='oanda']
```

In [14]:

```
statistics = df.columns[:17]
for statistic in statistics:
test = ttest_ind(fxcm.get(statistic), oanda.get(statistic), equal_var=False)[1]
print(statistic)
print("\t=> Is difference significative at 95%? {1}".format(statistic, test<0.05))
print("\t=> Is difference significative at 99%? {1}".format(statistic, test<0.01))
```

Well, seems FXCM has a significantly better performance than OANDA.

In [15]:

```
Image(url='http://i.imgur.com/sSDuZhu.png')
```

Out[15]:

In [16]:

```
Image(url='http://i.imgur.com/Qpq2LDL.png')
```

Out[16]:

In [17]:

```
Image(url='http://i.imgur.com/FlARWUo.png')
```

Out[17]:

In [ ]:

```
```