Backtest Kernel - DEMO


In [1]:
%matplotlib inline

from kernel import *
from oanda import *
from plotting import *

api = OANDAClient(OANDAPracticeConfig())
df = api.get_bars('EUR_USD', 'M30', 5000)
df.tail()


Out[1]:
closeMid complete datetime highMid lowMid openMid time volume
4995 1.139375 True 2015-10-13 20:00:00 1.139425 1.138385 1.138385 1444780800000000 158
4996 1.139650 True 2015-10-13 20:30:00 1.139660 1.139115 1.139400 1444782600000000 198
4997 1.139505 True 2015-10-13 21:00:00 1.140135 1.139475 1.139680 1444784400000000 237
4998 1.139230 True 2015-10-13 21:30:00 1.139540 1.138505 1.139540 1444786200000000 373
4999 1.138980 False 2015-10-13 22:00:00 1.139540 1.138720 1.139260 1444788000000000 92

Toy Strategy: DMA with Take_Profit/Stop_Loss


In [2]:
class DMA(StrategyTemplate):
    """
    DMA

    """

    def __init__(self, fast, slow, instrument='EUR_USD'):
        """

        """
        self.instrument = instrument
        self.history = []
        self.slow = slow
        self.fast = fast
        self.has_long = 0
        self.open_price = 0
        self.take_profit = 0

    def on_bar(self, bar):
        """
        Receive one bar, return signal, volume.
        :param bar: dict;
        :return: OrderType(Enum) object.
        """

        self.history.append(bar)
        curr_price = bar[BarColNames.close.value]
        # ---------------------------- #
        slow = np.mean([b[BarColNames.close.value]
                        for b in self.history[-1*self.slow:]])
        fast = np.mean([b[BarColNames.close.value]
                        for b in self.history[-1*self.fast:]])
        if fast > slow and (not self.has_long):
            self.has_long = 1
            self.open_price = curr_price
            return OrderType.buy, 10000
        if fast > slow and curr_price - self.open_price >= 0.01:  # take profit
            self.has_long = 1
            self.open_price = 0
            return OrderType.sell, 10000
        if curr_price - self.open_price <= -0.005:  # stop loss
            self.has_long = 1
            self.open_price = 0
            return OrderType.sell, 10000
        elif fast < slow:
            self.has_long = 0
            return OrderType.sell, 10000

        # ---------------------------- #
        return OrderType.none, 0

Report

  • plotting.report()

In [3]:
# Toy strategy


k = Kernel.naive(df)
s = DMA(20,45)
k.run_naive(s)
ax1,ax2,ax3 = report(k,ma1=20,ma2=45)


Export executed orders

  • Kernel.export_executed_orders()

In [4]:
k.export_executed_orders().head(10)


Out[4]:
direction instrument price target time volume
0 OrderType.buy EUR_USD 1.120105 None 2015-05-05 12:30:00 10000
1 OrderType.sell EUR_USD 1.133455 None 2015-05-06 09:30:00 10000
2 OrderType.buy EUR_USD 1.117625 None 2015-05-12 01:30:00 10000
3 OrderType.sell EUR_USD 1.121995 None 2015-05-12 21:30:00 10000
4 OrderType.buy EUR_USD 1.125085 None 2015-05-13 03:30:00 10000
5 OrderType.sell EUR_USD 1.135805 None 2015-05-13 11:00:00 10000
6 OrderType.buy EUR_USD 1.140335 None 2015-05-14 21:00:00 10000
7 OrderType.sell EUR_USD 1.135990 None 2015-05-15 04:30:00 10000
8 OrderType.buy EUR_USD 1.145140 None 2015-05-15 15:00:00 10000
9 OrderType.sell EUR_USD 1.139545 None 2015-05-18 03:00:00 10000

Export positions

  • Kernel.export_positions()

In [5]:
k.export_positions().head(10)


Out[5]:
close_price close_time direction instrument open_price open_time realized_pnl volume
0 1.133455 2015-05-06 09:30:00 PositionType.long EUR_USD 1.120105 2015-05-05 12:30:00 133.50 10000
1 1.121995 2015-05-12 21:30:00 PositionType.long EUR_USD 1.117625 2015-05-12 01:30:00 43.70 10000
2 1.135805 2015-05-13 11:00:00 PositionType.long EUR_USD 1.125085 2015-05-13 03:30:00 107.20 10000
3 1.135990 2015-05-15 04:30:00 PositionType.long EUR_USD 1.140335 2015-05-14 21:00:00 -43.45 10000
4 1.139545 2015-05-18 03:00:00 PositionType.long EUR_USD 1.145140 2015-05-15 15:00:00 -55.95 10000
5 1.111220 2015-05-21 16:30:00 PositionType.long EUR_USD 1.112235 2015-05-20 23:00:00 -10.15 10000
6 1.107970 2015-05-22 08:30:00 PositionType.long EUR_USD 1.116445 2015-05-22 03:00:00 -84.75 10000
7 1.086200 2015-05-27 07:30:00 PositionType.long EUR_USD 1.091595 2015-05-27 04:00:00 -53.95 10000
8 1.095255 2015-05-31 23:00:00 PositionType.long EUR_USD 1.090005 2015-05-27 19:00:00 52.50 10000
9 1.104440 2015-06-02 07:00:00 PositionType.long EUR_USD 1.092585 2015-06-01 23:00:00 118.55 10000

In [4]:
s2 = DMA(12,25)
k = Kernel.naive(api.get_bars('EUR_USD', 'H1', 2000))
k.run_naive(s2)
ax1,ax2,ax3 = report(k,ma1=12,ma2=25)



In [5]:
class DMA_200(StrategyTemplate):
    """
    DMA_200

    """

    def __init__(self, fast, slow=200, instrument='EUR_USD'):
        """

        """
        self.instrument = instrument
        self.history = []
        self.slow = slow
        self.fast = fast
        self.has_long = 0
        self.open_price = 0
        self.take_profit = 0

    def on_bar(self, bar):
        """
        Receive one bar, return signal, volume.
        :param bar: dict;
        :return: OrderType(Enum) object.
        """

        self.history.append(bar)
        curr_price = bar[BarColNames.close.value]
        # ---------------------------- #
        slow = np.mean([b[BarColNames.close.value]
                        for b in self.history[-1*self.slow:]])
        fast = np.mean([b[BarColNames.close.value]
                        for b in self.history[-1*self.fast:]])
        if fast > slow and (not self.has_long):
            self.has_long = 1
            self.open_price = curr_price
            return OrderType.buy, 10000
        elif fast < slow:
            self.has_long = 0
            return OrderType.sell, 10000

        # ---------------------------- #
        return OrderType.none, 0

In [6]:
s3 = DMA_200(10)
k = Kernel.naive(api.get_bars('EUR_USD', 'D', 4000))
k.run_naive(s3)
ax1,ax2,ax3 = report(k,ma1=7,ma2=200)



In [19]:
df = api.get_bars('EUR_USD', 'H1', 2000)
pnl_list = []
for fast in range(10,60):
    s2 = DMA(12,fast)
    k = Kernel.naive(df)
    pnl_list.append(k.run_naive(s2)[-1])
    print "Finished Simulation: MA2={}".format(fast)
pnl_list


Finished Simulation: MA2=10
Finished Simulation: MA2=11
Finished Simulation: MA2=12
Finished Simulation: MA2=13
Finished Simulation: MA2=14
Finished Simulation: MA2=15
Finished Simulation: MA2=16
Finished Simulation: MA2=17
Finished Simulation: MA2=18
Finished Simulation: MA2=19
Finished Simulation: MA2=20
Finished Simulation: MA2=21
Finished Simulation: MA2=22
Finished Simulation: MA2=23
Finished Simulation: MA2=24
Finished Simulation: MA2=25
Finished Simulation: MA2=26
Finished Simulation: MA2=27
Finished Simulation: MA2=28
Finished Simulation: MA2=29
Finished Simulation: MA2=30
Finished Simulation: MA2=31
Finished Simulation: MA2=32
Finished Simulation: MA2=33
Finished Simulation: MA2=34
Finished Simulation: MA2=35
Finished Simulation: MA2=36
Finished Simulation: MA2=37
Finished Simulation: MA2=38
Finished Simulation: MA2=39
Finished Simulation: MA2=40
Finished Simulation: MA2=41
Finished Simulation: MA2=42
Finished Simulation: MA2=43
Finished Simulation: MA2=44
Finished Simulation: MA2=45
Finished Simulation: MA2=46
Finished Simulation: MA2=47
Finished Simulation: MA2=48
Finished Simulation: MA2=49
Finished Simulation: MA2=50
Finished Simulation: MA2=51
Finished Simulation: MA2=52
Finished Simulation: MA2=53
Finished Simulation: MA2=54
Finished Simulation: MA2=55
Finished Simulation: MA2=56
Finished Simulation: MA2=57
Finished Simulation: MA2=58
Finished Simulation: MA2=59
Out[19]:
[999820.7000000002,
 999644.0000000001,
 1000000,
 1000002.1,
 1000147.6000000003,
 1000055.4000000001,
 999824.2,
 1000203.3000000007,
 1000211.3000000003,
 1000450.6,
 1000478.0500000003,
 1000282.3999999999,
 1000191.0500000002,
 1000278.7000000003,
 1000410.6,
 1000508.2499999999,
 1000399.65,
 1000319.6000000001,
 1000491.7000000003,
 1000378.9000000004,
 1000453.8500000003,
 1000514.9500000003,
 1000659.3,
 1000561.8,
 1000653.15,
 1000595.3499999999,
 1000533.0499999999,
 1000182.4999999999,
 1000193.4,
 1000057.5499999999,
 1000030.6000000001,
 1000093.6000000001,
 1000125.15,
 1000062.75,
 1000136.7499999999,
 1000118.3500000001,
 1000120.65,
 1000278.6,
 1000337.75,
 1000211.0,
 1000185.1499999999,
 1000195.75,
 1000265.1999999998,
 1000026.5499999998,
 1000296.6499999999,
 1000294.5499999998,
 1000201.55,
 1000114.75,
 1000071.3999999999,
 1000056.3]

In [9]:
range(25,30)


Out[9]:
[25, 26, 27, 28, 29]

In [20]:
plt.plot(pnl_list)


Out[20]:
[<matplotlib.lines.Line2D at 0x102408210>]

In [48]:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np


Z = numpy.zeros(shape=(30,30))

df = api.get_bars('EUR_USD', 'H1', 2000)
slow = 10
delta_fast = 6
for i in range(0, 30):
    delta_fast = 6
    slow = slow + 1
    for j in range(0,30):
        delta_fast += 2
        fast = slow + delta_fast
        s2 = DMA(slow,slow+delta_fast)
        k = Kernel.naive(df)
        Z[i][j] = k.run_naive(s2)[-1]
        print "Finished Simulation: {},{}".format(i,j)
Z


Finished Simulation: 0,0
Finished Simulation: 0,1
Finished Simulation: 0,2
Finished Simulation: 0,3
Finished Simulation: 0,4
Finished Simulation: 0,5
Finished Simulation: 0,6
Finished Simulation: 0,7
Finished Simulation: 0,8
Finished Simulation: 0,9
Finished Simulation: 0,10
Finished Simulation: 0,11
Finished Simulation: 0,12
Finished Simulation: 0,13
Finished Simulation: 0,14
Finished Simulation: 0,15
Finished Simulation: 0,16
Finished Simulation: 0,17
Finished Simulation: 0,18
Finished Simulation: 0,19
Finished Simulation: 0,20
Finished Simulation: 0,21
Finished Simulation: 0,22
Finished Simulation: 0,23
Finished Simulation: 0,24
Finished Simulation: 0,25
Finished Simulation: 0,26
Finished Simulation: 0,27
Finished Simulation: 0,28
Finished Simulation: 0,29
Finished Simulation: 1,0
Finished Simulation: 1,1
Finished Simulation: 1,2
Finished Simulation: 1,3
Finished Simulation: 1,4
Finished Simulation: 1,5
Finished Simulation: 1,6
Finished Simulation: 1,7
Finished Simulation: 1,8
Finished Simulation: 1,9
Finished Simulation: 1,10
Finished Simulation: 1,11
Finished Simulation: 1,12
Finished Simulation: 1,13
Finished Simulation: 1,14
Finished Simulation: 1,15
Finished Simulation: 1,16
Finished Simulation: 1,17
Finished Simulation: 1,18
Finished Simulation: 1,19
Finished Simulation: 1,20
Finished Simulation: 1,21
Finished Simulation: 1,22
Finished Simulation: 1,23
Finished Simulation: 1,24
Finished Simulation: 1,25
Finished Simulation: 1,26
Finished Simulation: 1,27
Finished Simulation: 1,28
Finished Simulation: 1,29
Finished Simulation: 2,0
Finished Simulation: 2,1
Finished Simulation: 2,2
Finished Simulation: 2,3
Finished Simulation: 2,4
Finished Simulation: 2,5
Finished Simulation: 2,6
Finished Simulation: 2,7
Finished Simulation: 2,8
Finished Simulation: 2,9
Finished Simulation: 2,10
Finished Simulation: 2,11
Finished Simulation: 2,12
Finished Simulation: 2,13
Finished Simulation: 2,14
Finished Simulation: 2,15
Finished Simulation: 2,16
Finished Simulation: 2,17
Finished Simulation: 2,18
Finished Simulation: 2,19
Finished Simulation: 2,20
Finished Simulation: 2,21
Finished Simulation: 2,22
Finished Simulation: 2,23
Finished Simulation: 2,24
Finished Simulation: 2,25
Finished Simulation: 2,26
Finished Simulation: 2,27
Finished Simulation: 2,28
Finished Simulation: 2,29
Finished Simulation: 3,0
Finished Simulation: 3,1
Finished Simulation: 3,2
Finished Simulation: 3,3
Finished Simulation: 3,4
Finished Simulation: 3,5
Finished Simulation: 3,6
Finished Simulation: 3,7
Finished Simulation: 3,8
Finished Simulation: 3,9
Finished Simulation: 3,10
Finished Simulation: 3,11
Finished Simulation: 3,12
Finished Simulation: 3,13
Finished Simulation: 3,14
Finished Simulation: 3,15
Finished Simulation: 3,16
Finished Simulation: 3,17
Finished Simulation: 3,18
Finished Simulation: 3,19
Finished Simulation: 3,20
Finished Simulation: 3,21
Finished Simulation: 3,22
Finished Simulation: 3,23
Finished Simulation: 3,24
Finished Simulation: 3,25
Finished Simulation: 3,26
Finished Simulation: 3,27
Finished Simulation: 3,28
Finished Simulation: 3,29
Finished Simulation: 4,0
Finished Simulation: 4,1
Finished Simulation: 4,2
Finished Simulation: 4,3
Finished Simulation: 4,4
Finished Simulation: 4,5
Finished Simulation: 4,6
Finished Simulation: 4,7
Finished Simulation: 4,8
Finished Simulation: 4,9
Finished Simulation: 4,10
Finished Simulation: 4,11
Finished Simulation: 4,12
Finished Simulation: 4,13
Finished Simulation: 4,14
Finished Simulation: 4,15
Finished Simulation: 4,16
Finished Simulation: 4,17
Finished Simulation: 4,18
Finished Simulation: 4,19
Finished Simulation: 4,20
Finished Simulation: 4,21
Finished Simulation: 4,22
Finished Simulation: 4,23
Finished Simulation: 4,24
Finished Simulation: 4,25
Finished Simulation: 4,26
Finished Simulation: 4,27
Finished Simulation: 4,28
Finished Simulation: 4,29
Finished Simulation: 5,0
Finished Simulation: 5,1
Finished Simulation: 5,2
Finished Simulation: 5,3
Finished Simulation: 5,4
Finished Simulation: 5,5
Finished Simulation: 5,6
Finished Simulation: 5,7
Finished Simulation: 5,8
Finished Simulation: 5,9
Finished Simulation: 5,10
Finished Simulation: 5,11
Finished Simulation: 5,12
Finished Simulation: 5,13
Finished Simulation: 5,14
Finished Simulation: 5,15
Finished Simulation: 5,16
Finished Simulation: 5,17
Finished Simulation: 5,18
Finished Simulation: 5,19
Finished Simulation: 5,20
Finished Simulation: 5,21
Finished Simulation: 5,22
Finished Simulation: 5,23
Finished Simulation: 5,24
Finished Simulation: 5,25
Finished Simulation: 5,26
Finished Simulation: 5,27
Finished Simulation: 5,28
Finished Simulation: 5,29
Finished Simulation: 6,0
Finished Simulation: 6,1
Finished Simulation: 6,2
Finished Simulation: 6,3
Finished Simulation: 6,4
Finished Simulation: 6,5
Finished Simulation: 6,6
Finished Simulation: 6,7
Finished Simulation: 6,8
Finished Simulation: 6,9
Finished Simulation: 6,10
Finished Simulation: 6,11
Finished Simulation: 6,12
Finished Simulation: 6,13
Finished Simulation: 6,14
Finished Simulation: 6,15
Finished Simulation: 6,16
Finished Simulation: 6,17
Finished Simulation: 6,18
Finished Simulation: 6,19
Finished Simulation: 6,20
Finished Simulation: 6,21
Finished Simulation: 6,22
Finished Simulation: 6,23
Finished Simulation: 6,24
Finished Simulation: 6,25
Finished Simulation: 6,26
Finished Simulation: 6,27
Finished Simulation: 6,28
Finished Simulation: 6,29
Finished Simulation: 7,0
Finished Simulation: 7,1
Finished Simulation: 7,2
Finished Simulation: 7,3
Finished Simulation: 7,4
Finished Simulation: 7,5
Finished Simulation: 7,6
Finished Simulation: 7,7
Finished Simulation: 7,8
Finished Simulation: 7,9
Finished Simulation: 7,10
Finished Simulation: 7,11
Finished Simulation: 7,12
Finished Simulation: 7,13
Finished Simulation: 7,14
Finished Simulation: 7,15
Finished Simulation: 7,16
Finished Simulation: 7,17
Finished Simulation: 7,18
Finished Simulation: 7,19
Finished Simulation: 7,20
Finished Simulation: 7,21
Finished Simulation: 7,22
Finished Simulation: 7,23
Finished Simulation: 7,24
Finished Simulation: 7,25
Finished Simulation: 7,26
Finished Simulation: 7,27
Finished Simulation: 7,28
Finished Simulation: 7,29
Finished Simulation: 8,0
Finished Simulation: 8,1
Finished Simulation: 8,2
Finished Simulation: 8,3
Finished Simulation: 8,4
Finished Simulation: 8,5
Finished Simulation: 8,6
Finished Simulation: 8,7
Finished Simulation: 8,8
Finished Simulation: 8,9
Finished Simulation: 8,10
Finished Simulation: 8,11
Finished Simulation: 8,12
Finished Simulation: 8,13
Finished Simulation: 8,14
Finished Simulation: 8,15
Finished Simulation: 8,16
Finished Simulation: 8,17
Finished Simulation: 8,18
Finished Simulation: 8,19
Finished Simulation: 8,20
Finished Simulation: 8,21
Finished Simulation: 8,22
Finished Simulation: 8,23
Finished Simulation: 8,24
Finished Simulation: 8,25
Finished Simulation: 8,26
Finished Simulation: 8,27
Finished Simulation: 8,28
Finished Simulation: 8,29
Finished Simulation: 9,0
Finished Simulation: 9,1
Finished Simulation: 9,2
Finished Simulation: 9,3
Finished Simulation: 9,4
Finished Simulation: 9,5
Finished Simulation: 9,6
Finished Simulation: 9,7
Finished Simulation: 9,8
Finished Simulation: 9,9
Finished Simulation: 9,10
Finished Simulation: 9,11
Finished Simulation: 9,12
Finished Simulation: 9,13
Finished Simulation: 9,14
Finished Simulation: 9,15
Finished Simulation: 9,16
Finished Simulation: 9,17
Finished Simulation: 9,18
Finished Simulation: 9,19
Finished Simulation: 9,20
Finished Simulation: 9,21
Finished Simulation: 9,22
Finished Simulation: 9,23
Finished Simulation: 9,24
Finished Simulation: 9,25
Finished Simulation: 9,26
Finished Simulation: 9,27
Finished Simulation: 9,28
Finished Simulation: 9,29
Finished Simulation: 10,0
Finished Simulation: 10,1
Finished Simulation: 10,2
Finished Simulation: 10,3
Finished Simulation: 10,4
Finished Simulation: 10,5
Finished Simulation: 10,6
Finished Simulation: 10,7
Finished Simulation: 10,8
Finished Simulation: 10,9
Finished Simulation: 10,10
Finished Simulation: 10,11
Finished Simulation: 10,12
Finished Simulation: 10,13
Finished Simulation: 10,14
Finished Simulation: 10,15
Finished Simulation: 10,16
Finished Simulation: 10,17
Finished Simulation: 10,18
Finished Simulation: 10,19
Finished Simulation: 10,20
Finished Simulation: 10,21
Finished Simulation: 10,22
Finished Simulation: 10,23
Finished Simulation: 10,24
Finished Simulation: 10,25
Finished Simulation: 10,26
Finished Simulation: 10,27
Finished Simulation: 10,28
Finished Simulation: 10,29
Finished Simulation: 11,0
Finished Simulation: 11,1
Finished Simulation: 11,2
Finished Simulation: 11,3
Finished Simulation: 11,4
Finished Simulation: 11,5
Finished Simulation: 11,6
Finished Simulation: 11,7
Finished Simulation: 11,8
Finished Simulation: 11,9
Finished Simulation: 11,10
Finished Simulation: 11,11
Finished Simulation: 11,12
Finished Simulation: 11,13
Finished Simulation: 11,14
Finished Simulation: 11,15
Finished Simulation: 11,16
Finished Simulation: 11,17
Finished Simulation: 11,18
Finished Simulation: 11,19
Finished Simulation: 11,20
Finished Simulation: 11,21
Finished Simulation: 11,22
Finished Simulation: 11,23
Finished Simulation: 11,24
Finished Simulation: 11,25
Finished Simulation: 11,26
Finished Simulation: 11,27
Finished Simulation: 11,28
Finished Simulation: 11,29
Finished Simulation: 12,0
Finished Simulation: 12,1
Finished Simulation: 12,2
Finished Simulation: 12,3
Finished Simulation: 12,4
Finished Simulation: 12,5
Finished Simulation: 12,6
Finished Simulation: 12,7
Finished Simulation: 12,8
Finished Simulation: 12,9
Finished Simulation: 12,10
Finished Simulation: 12,11
Finished Simulation: 12,12
Finished Simulation: 12,13
Finished Simulation: 12,14
Finished Simulation: 12,15
Finished Simulation: 12,16
Finished Simulation: 12,17
Finished Simulation: 12,18
Finished Simulation: 12,19
Finished Simulation: 12,20
Finished Simulation: 12,21
Finished Simulation: 12,22
Finished Simulation: 12,23
Finished Simulation: 12,24
Finished Simulation: 12,25
Finished Simulation: 12,26
Finished Simulation: 12,27
Finished Simulation: 12,28
Finished Simulation: 12,29
Finished Simulation: 13,0
Finished Simulation: 13,1
Finished Simulation: 13,2
Finished Simulation: 13,3
Finished Simulation: 13,4
Finished Simulation: 13,5
Finished Simulation: 13,6
Finished Simulation: 13,7
Finished Simulation: 13,8
Finished Simulation: 13,9
Finished Simulation: 13,10
Finished Simulation: 13,11
Finished Simulation: 13,12
Finished Simulation: 13,13
Finished Simulation: 13,14
Finished Simulation: 13,15
Finished Simulation: 13,16
Finished Simulation: 13,17
Finished Simulation: 13,18
Finished Simulation: 13,19
Finished Simulation: 13,20
Finished Simulation: 13,21
Finished Simulation: 13,22
Finished Simulation: 13,23
Finished Simulation: 13,24
Finished Simulation: 13,25
Finished Simulation: 13,26
Finished Simulation: 13,27
Finished Simulation: 13,28
Finished Simulation: 13,29
Finished Simulation: 14,0
Finished Simulation: 14,1
Finished Simulation: 14,2
Finished Simulation: 14,3
Finished Simulation: 14,4
Finished Simulation: 14,5
Finished Simulation: 14,6
Finished Simulation: 14,7
Finished Simulation: 14,8
Finished Simulation: 14,9
Finished Simulation: 14,10
Finished Simulation: 14,11
Finished Simulation: 14,12
Finished Simulation: 14,13
Finished Simulation: 14,14
Finished Simulation: 14,15
Finished Simulation: 14,16
Finished Simulation: 14,17
Finished Simulation: 14,18
Finished Simulation: 14,19
Finished Simulation: 14,20
Finished Simulation: 14,21
Finished Simulation: 14,22
Finished Simulation: 14,23
Finished Simulation: 14,24
Finished Simulation: 14,25
Finished Simulation: 14,26
Finished Simulation: 14,27
Finished Simulation: 14,28
Finished Simulation: 14,29
Finished Simulation: 15,0
Finished Simulation: 15,1
Finished Simulation: 15,2
Finished Simulation: 15,3
Finished Simulation: 15,4
Finished Simulation: 15,5
Finished Simulation: 15,6
Finished Simulation: 15,7
Finished Simulation: 15,8
Finished Simulation: 15,9
Finished Simulation: 15,10
Finished Simulation: 15,11
Finished Simulation: 15,12
Finished Simulation: 15,13
Finished Simulation: 15,14
Finished Simulation: 15,15
Finished Simulation: 15,16
Finished Simulation: 15,17
Finished Simulation: 15,18
Finished Simulation: 15,19
Finished Simulation: 15,20
Finished Simulation: 15,21
Finished Simulation: 15,22
Finished Simulation: 15,23
Finished Simulation: 15,24
Finished Simulation: 15,25
Finished Simulation: 15,26
Finished Simulation: 15,27
Finished Simulation: 15,28
Finished Simulation: 15,29
Finished Simulation: 16,0
Finished Simulation: 16,1
Finished Simulation: 16,2
Finished Simulation: 16,3
Finished Simulation: 16,4
Finished Simulation: 16,5
Finished Simulation: 16,6
Finished Simulation: 16,7
Finished Simulation: 16,8
Finished Simulation: 16,9
Finished Simulation: 16,10
Finished Simulation: 16,11
Finished Simulation: 16,12
Finished Simulation: 16,13
Finished Simulation: 16,14
Finished Simulation: 16,15
Finished Simulation: 16,16
Finished Simulation: 16,17
Finished Simulation: 16,18
Finished Simulation: 16,19
Finished Simulation: 16,20
Finished Simulation: 16,21
Finished Simulation: 16,22
Finished Simulation: 16,23
Finished Simulation: 16,24
Finished Simulation: 16,25
Finished Simulation: 16,26
Finished Simulation: 16,27
Finished Simulation: 16,28
Finished Simulation: 16,29
Finished Simulation: 17,0
Finished Simulation: 17,1
Finished Simulation: 17,2
Finished Simulation: 17,3
Finished Simulation: 17,4
Finished Simulation: 17,5
Finished Simulation: 17,6
Finished Simulation: 17,7
Finished Simulation: 17,8
Finished Simulation: 17,9
Finished Simulation: 17,10
Finished Simulation: 17,11
Finished Simulation: 17,12
Finished Simulation: 17,13
Finished Simulation: 17,14
Finished Simulation: 17,15
Finished Simulation: 17,16
Finished Simulation: 17,17
Finished Simulation: 17,18
Finished Simulation: 17,19
Finished Simulation: 17,20
Finished Simulation: 17,21
Finished Simulation: 17,22
Finished Simulation: 17,23
Finished Simulation: 17,24
Finished Simulation: 17,25
Finished Simulation: 17,26
Finished Simulation: 17,27
Finished Simulation: 17,28
Finished Simulation: 17,29
Finished Simulation: 18,0
Finished Simulation: 18,1
Finished Simulation: 18,2
Finished Simulation: 18,3
Finished Simulation: 18,4
Finished Simulation: 18,5
Finished Simulation: 18,6
Finished Simulation: 18,7
Finished Simulation: 18,8
Finished Simulation: 18,9
Finished Simulation: 18,10
Finished Simulation: 18,11
Finished Simulation: 18,12
Finished Simulation: 18,13
Finished Simulation: 18,14
Finished Simulation: 18,15
Finished Simulation: 18,16
Finished Simulation: 18,17
Finished Simulation: 18,18
Finished Simulation: 18,19
Finished Simulation: 18,20
Finished Simulation: 18,21
Finished Simulation: 18,22
Finished Simulation: 18,23
Finished Simulation: 18,24
Finished Simulation: 18,25
Finished Simulation: 18,26
Finished Simulation: 18,27
Finished Simulation: 18,28
Finished Simulation: 18,29
Finished Simulation: 19,0
Finished Simulation: 19,1
Finished Simulation: 19,2
Finished Simulation: 19,3
Finished Simulation: 19,4
Finished Simulation: 19,5
Finished Simulation: 19,6
Finished Simulation: 19,7
Finished Simulation: 19,8
Finished Simulation: 19,9
Finished Simulation: 19,10
Finished Simulation: 19,11
Finished Simulation: 19,12
Finished Simulation: 19,13
Finished Simulation: 19,14
Finished Simulation: 19,15
Finished Simulation: 19,16
Finished Simulation: 19,17
Finished Simulation: 19,18
Finished Simulation: 19,19
Finished Simulation: 19,20
Finished Simulation: 19,21
Finished Simulation: 19,22
Finished Simulation: 19,23
Finished Simulation: 19,24
Finished Simulation: 19,25
Finished Simulation: 19,26
Finished Simulation: 19,27
Finished Simulation: 19,28
Finished Simulation: 19,29
Finished Simulation: 20,0
Finished Simulation: 20,1
Finished Simulation: 20,2
Finished Simulation: 20,3
Finished Simulation: 20,4
Finished Simulation: 20,5
Finished Simulation: 20,6
Finished Simulation: 20,7
Finished Simulation: 20,8
Finished Simulation: 20,9
Finished Simulation: 20,10
Finished Simulation: 20,11
Finished Simulation: 20,12
Finished Simulation: 20,13
Finished Simulation: 20,14
Finished Simulation: 20,15
Finished Simulation: 20,16
Finished Simulation: 20,17
Finished Simulation: 20,18
Finished Simulation: 20,19
Finished Simulation: 20,20
Finished Simulation: 20,21
Finished Simulation: 20,22
Finished Simulation: 20,23
Finished Simulation: 20,24
Finished Simulation: 20,25
Finished Simulation: 20,26
Finished Simulation: 20,27
Finished Simulation: 20,28
Finished Simulation: 20,29
Finished Simulation: 21,0
Finished Simulation: 21,1
Finished Simulation: 21,2
Finished Simulation: 21,3
Finished Simulation: 21,4
Finished Simulation: 21,5
Finished Simulation: 21,6
Finished Simulation: 21,7
Finished Simulation: 21,8
Finished Simulation: 21,9
Finished Simulation: 21,10
Finished Simulation: 21,11
Finished Simulation: 21,12
Finished Simulation: 21,13
Finished Simulation: 21,14
Finished Simulation: 21,15
Finished Simulation: 21,16
Finished Simulation: 21,17
Finished Simulation: 21,18
Finished Simulation: 21,19
Finished Simulation: 21,20
Finished Simulation: 21,21
Finished Simulation: 21,22
Finished Simulation: 21,23
Finished Simulation: 21,24
Finished Simulation: 21,25
Finished Simulation: 21,26
Finished Simulation: 21,27
Finished Simulation: 21,28
Finished Simulation: 21,29
Finished Simulation: 22,0
Finished Simulation: 22,1
Finished Simulation: 22,2
Finished Simulation: 22,3
Finished Simulation: 22,4
Finished Simulation: 22,5
Finished Simulation: 22,6
Finished Simulation: 22,7
Finished Simulation: 22,8
Finished Simulation: 22,9
Finished Simulation: 22,10
Finished Simulation: 22,11
Finished Simulation: 22,12
Finished Simulation: 22,13
Finished Simulation: 22,14
Finished Simulation: 22,15
Finished Simulation: 22,16
Finished Simulation: 22,17
Finished Simulation: 22,18
Finished Simulation: 22,19
Finished Simulation: 22,20
Finished Simulation: 22,21
Finished Simulation: 22,22
Finished Simulation: 22,23
Finished Simulation: 22,24
Finished Simulation: 22,25
Finished Simulation: 22,26
Finished Simulation: 22,27
Finished Simulation: 22,28
Finished Simulation: 22,29
Finished Simulation: 23,0
Finished Simulation: 23,1
Finished Simulation: 23,2
Finished Simulation: 23,3
Finished Simulation: 23,4
Finished Simulation: 23,5
Finished Simulation: 23,6
Finished Simulation: 23,7
Finished Simulation: 23,8
Finished Simulation: 23,9
Finished Simulation: 23,10
Finished Simulation: 23,11
Finished Simulation: 23,12
Finished Simulation: 23,13
Finished Simulation: 23,14
Finished Simulation: 23,15
Finished Simulation: 23,16
Finished Simulation: 23,17
Finished Simulation: 23,18
Finished Simulation: 23,19
Finished Simulation: 23,20
Finished Simulation: 23,21
Finished Simulation: 23,22
Finished Simulation: 23,23
Finished Simulation: 23,24
Finished Simulation: 23,25
Finished Simulation: 23,26
Finished Simulation: 23,27
Finished Simulation: 23,28
Finished Simulation: 23,29
Finished Simulation: 24,0
Finished Simulation: 24,1
Finished Simulation: 24,2
Finished Simulation: 24,3
Finished Simulation: 24,4
Finished Simulation: 24,5
Finished Simulation: 24,6
Finished Simulation: 24,7
Finished Simulation: 24,8
Finished Simulation: 24,9
Finished Simulation: 24,10
Finished Simulation: 24,11
Finished Simulation: 24,12
Finished Simulation: 24,13
Finished Simulation: 24,14
Finished Simulation: 24,15
Finished Simulation: 24,16
Finished Simulation: 24,17
Finished Simulation: 24,18
Finished Simulation: 24,19
Finished Simulation: 24,20
Finished Simulation: 24,21
Finished Simulation: 24,22
Finished Simulation: 24,23
Finished Simulation: 24,24
Finished Simulation: 24,25
Finished Simulation: 24,26
Finished Simulation: 24,27
Finished Simulation: 24,28
Finished Simulation: 24,29
Finished Simulation: 25,0
Finished Simulation: 25,1
Finished Simulation: 25,2
Finished Simulation: 25,3
Finished Simulation: 25,4
Finished Simulation: 25,5
Finished Simulation: 25,6
Finished Simulation: 25,7
Finished Simulation: 25,8
Finished Simulation: 25,9
Finished Simulation: 25,10
Finished Simulation: 25,11
Finished Simulation: 25,12
Finished Simulation: 25,13
Finished Simulation: 25,14
Finished Simulation: 25,15
Finished Simulation: 25,16
Finished Simulation: 25,17
Finished Simulation: 25,18
Finished Simulation: 25,19
Finished Simulation: 25,20
Finished Simulation: 25,21
Finished Simulation: 25,22
Finished Simulation: 25,23
Finished Simulation: 25,24
Finished Simulation: 25,25
Finished Simulation: 25,26
Finished Simulation: 25,27
Finished Simulation: 25,28
Finished Simulation: 25,29
Finished Simulation: 26,0
Finished Simulation: 26,1
Finished Simulation: 26,2
Finished Simulation: 26,3
Finished Simulation: 26,4
Finished Simulation: 26,5
Finished Simulation: 26,6
Finished Simulation: 26,7
Finished Simulation: 26,8
Finished Simulation: 26,9
Finished Simulation: 26,10
Finished Simulation: 26,11
Finished Simulation: 26,12
Finished Simulation: 26,13
Finished Simulation: 26,14
Finished Simulation: 26,15
Finished Simulation: 26,16
Finished Simulation: 26,17
Finished Simulation: 26,18
Finished Simulation: 26,19
Finished Simulation: 26,20
Finished Simulation: 26,21
Finished Simulation: 26,22
Finished Simulation: 26,23
Finished Simulation: 26,24
Finished Simulation: 26,25
Finished Simulation: 26,26
Finished Simulation: 26,27
Finished Simulation: 26,28
Finished Simulation: 26,29
Finished Simulation: 27,0
Finished Simulation: 27,1
Finished Simulation: 27,2
Finished Simulation: 27,3
Finished Simulation: 27,4
Finished Simulation: 27,5
Finished Simulation: 27,6
Finished Simulation: 27,7
Finished Simulation: 27,8
Finished Simulation: 27,9
Finished Simulation: 27,10
Finished Simulation: 27,11
Finished Simulation: 27,12
Finished Simulation: 27,13
Finished Simulation: 27,14
Finished Simulation: 27,15
Finished Simulation: 27,16
Finished Simulation: 27,17
Finished Simulation: 27,18
Finished Simulation: 27,19
Finished Simulation: 27,20
Finished Simulation: 27,21
Finished Simulation: 27,22
Finished Simulation: 27,23
Finished Simulation: 27,24
Finished Simulation: 27,25
Finished Simulation: 27,26
Finished Simulation: 27,27
Finished Simulation: 27,28
Finished Simulation: 27,29
Finished Simulation: 28,0
Finished Simulation: 28,1
Finished Simulation: 28,2
Finished Simulation: 28,3
Finished Simulation: 28,4
Finished Simulation: 28,5
Finished Simulation: 28,6
Finished Simulation: 28,7
Finished Simulation: 28,8
Finished Simulation: 28,9
Finished Simulation: 28,10
Finished Simulation: 28,11
Finished Simulation: 28,12
Finished Simulation: 28,13
Finished Simulation: 28,14
Finished Simulation: 28,15
Finished Simulation: 28,16
Finished Simulation: 28,17
Finished Simulation: 28,18
Finished Simulation: 28,19
Finished Simulation: 28,20
Finished Simulation: 28,21
Finished Simulation: 28,22
Finished Simulation: 28,23
Finished Simulation: 28,24
Finished Simulation: 28,25
Finished Simulation: 28,26
Finished Simulation: 28,27
Finished Simulation: 28,28
Finished Simulation: 28,29
Finished Simulation: 29,0
Finished Simulation: 29,1
Finished Simulation: 29,2
Finished Simulation: 29,3
Finished Simulation: 29,4
Finished Simulation: 29,5
Finished Simulation: 29,6
Finished Simulation: 29,7
Finished Simulation: 29,8
Finished Simulation: 29,9
Finished Simulation: 29,10
Finished Simulation: 29,11
Finished Simulation: 29,12
Finished Simulation: 29,13
Finished Simulation: 29,14
Finished Simulation: 29,15
Finished Simulation: 29,16
Finished Simulation: 29,17
Finished Simulation: 29,18
Finished Simulation: 29,19
Finished Simulation: 29,20
Finished Simulation: 29,21
Finished Simulation: 29,22
Finished Simulation: 29,23
Finished Simulation: 29,24
Finished Simulation: 29,25
Finished Simulation: 29,26
Finished Simulation: 29,27
Finished Simulation: 29,28
Finished Simulation: 29,29
Out[48]:
array([[ 1000327.55,  1000301.9 ,  1000437.9 ,  1000113.45,  1000311.3 ,
         1000511.75,  1000470.3 ,  1000503.75,  1000777.5 ,  1000807.35,
         1000268.05,  1000292.65,  1000146.5 ,  1000117.3 ,  1000048.1 ,
          999982.55,  1000341.55,  1000267.7 ,  1000353.6 ,  1000342.35,
         1000153.5 ,  1000069.55,  1000015.8 ,  1000045.1 ,  1000069.3 ,
          999818.8 ,   999793.55,   999794.65,   999792.4 ,   999811.6 ],
       [ 1000483.05,  1000196.05,  1000415.6 ,  1000404.65,  1000496.7 ,
         1000458.85,  1000664.3 ,  1000658.15,  1000538.05,  1000198.4 ,
         1000035.6 ,  1000130.15,  1000141.75,  1000125.65,  1000342.75,
         1000190.15,  1000265.2 ,  1000296.65,  1000201.55,  1000071.4 ,
         1000061.3 ,  1000019.3 ,  1000053.55,   999888.85,   999898.6 ,
          999837.9 ,   999967.55,   999933.2 ,   999979.  ,   999863.2 ],
       [ 1000325.  ,  1000300.45,  1000299.35,  1000386.9 ,  1000172.2 ,
         1000432.55,  1000497.35,  1000703.8 ,   999923.5 ,  1000037.3 ,
          999973.45,   999930.1 ,   999889.85,  1000080.6 ,  1000352.15,
         1000325.35,  1000225.  ,  1000127.8 ,   999896.05,   999892.65,
          999833.25,   999802.65,   999902.55,  1000050.5 ,  1000035.65,
         1000117.65,   999986.7 ,  1000008.7 ,  1000016.65,  1000009.35],
       [ 1000348.5 ,  1000324.6 ,  1000288.5 ,  1000156.75,  1000402.95,
         1000573.1 ,  1000379.3 ,  1000147.35,  1000314.15,  1000111.9 ,
         1000217.85,  1000069.25,   999957.05,  1000163.95,  1000374.15,
         1000597.75,  1000137.05,   999906.8 ,   999907.4 ,   999856.05,
          999999.65,  1000038.25,   999993.85,  1000054.35,  1000060.65,
         1000064.3 ,  1000236.4 ,  1000194.1 ,   999835.1 ,   999870.3 ],
       [ 1000486.65,  1000230.3 ,  1000153.5 ,  1000494.15,  1000526.1 ,
         1000435.75,   999711.1 ,  1000097.7 ,  1000375.45,  1000013.75,
         1000432.5 ,  1000307.75,  1000295.25,  1000436.35,  1000425.25,
         1000557.5 ,  1000098.4 ,   999922.75,   999885.55,   999995.3 ,
          999958.45,  1000061.15,  1000042.15,  1000103.8 ,  1000258.8 ,
         1000034.6 ,  1000093.55,   999876.5 ,   999931.1 ,  1000089.05],
       [ 1000087.85,  1000268.8 ,  1000421.5 ,  1000308.1 ,  1000188.05,
          999816.35,  1000108.35,  1000074.25,   999990.75,  1000154.8 ,
         1000195.7 ,  1000326.4 ,  1000542.45,  1000613.6 ,  1000582.75,
         1000304.65,   999902.25,   999926.9 ,  1000054.1 ,  1000036.65,
         1000016.85,  1000078.15,   999911.65,  1000078.9 ,  1000040.15,
          999989.25,   999854.95,   999756.4 ,   999785.05,   999916.6 ],
       [ 1000279.2 ,  1000374.5 ,  1000168.95,  1000075.  ,   999705.8 ,
         1000006.55,  1000014.2 ,   999922.65,  1000170.  ,  1000139.15,
         1000093.2 ,  1000348.25,  1000352.35,  1000305.5 ,  1000439.65,
         1000116.1 ,   999989.25,  1000044.7 ,  1000097.2 ,  1000109.95,
          999871.75,   999904.1 ,  1000048.75,   999985.65,  1000031.7 ,
          999814.8 ,   999742.9 ,   999743.7 ,   999879.25,   999917.  ],
       [ 1000275.55,  1000324.65,  1000097.35,   999935.85,  1000032.8 ,
          999906.95,   999903.5 ,  1000185.7 ,  1000192.25,  1000232.15,
         1000287.75,  1000352.7 ,  1000352.1 ,  1000278.  ,  1000292.15,
         1000134.7 ,  1000032.4 ,  1000070.95,  1000061.2 ,  1000045.85,
         1000040.9 ,  1000058.65,  1000043.05,  1000061.2 ,   999634.9 ,
          999687.25,   999715.05,   999730.95,   999937.75,   999802.75],
       [ 1000340.9 ,  1000108.55,   999893.15,   999918.1 ,   999911.1 ,
         1000122.8 ,  1000334.8 ,  1000220.6 ,  1000163.65,  1000163.45,
         1000459.8 ,  1000313.15,  1000434.25,  1000434.9 ,  1000394.35,
         1000050.55,  1000267.55,  1000102.3 ,  1000097.1 ,  1000096.4 ,
         1000023.05,  1000045.15,  1000028.  ,   999631.6 ,   999692.2 ,
          999685.85,   999725.15,   999912.1 ,   999772.4 ,   999774.75],
       [ 1000015.65,  1000006.75,   999967.65,   999925.7 ,   999963.55,
         1000152.95,   999989.4 ,  1000152.05,  1000050.6 ,  1000409.25,
         1000248.95,  1000128.15,  1000281.35,  1000351.85,  1000433.65,
         1000149.9 ,  1000095.2 ,  1000028.85,  1000069.25,  1000037.75,
         1000067.4 ,  1000075.  ,   999696.95,   999653.6 ,   999625.45,
          999664.45,   999938.45,   999965.4 ,   999797.35,   999784.2 ],
       [  999872.5 ,   999788.25,   999919.  ,  1000085.1 ,  1000155.25,
         1000179.45,  1000007.15,  1000011.1 ,  1000275.9 ,  1000231.65,
         1000163.1 ,  1000184.55,  1000309.6 ,  1000396.55,  1000130.85,
         1000087.3 ,  1000087.85,  1000083.5 ,   999882.4 ,  1000031.25,
         1000004.65,   999664.2 ,   999667.75,   999690.6 ,   999655.4 ,
          999657.95,   999782.7 ,   999750.1 ,   999751.6 ,   999810.8 ],
       [  999551.4 ,   999893.3 ,  1000127.55,  1000078.45,  1000001.95,
          999996.65,  1000072.75,  1000105.35,  1000214.75,  1000087.2 ,
         1000048.  ,  1000191.85,  1000352.65,  1000443.6 ,  1000092.2 ,
         1000096.6 ,  1000070.95,   999845.9 ,   999754.35,   999788.9 ,
          999655.65,   999682.55,   999695.1 ,   999652.5 ,   999693.5 ,
          999870.5 ,   999737.  ,   999725.2 ,   999824.7 ,   999803.7 ],
       [  999732.45,   999825.4 ,  1000039.45,  1000011.3 ,  1000095.55,
         1000036.9 ,  1000222.35,  1000186.4 ,  1000145.45,  1000006.05,
         1000036.4 ,  1000295.95,  1000335.4 ,  1000256.8 ,  1000097.05,
         1000073.5 ,   999920.15,   999816.7 ,   999752.5 ,   999808.55,
          999677.55,   999654.55,   999658.05,   999638.4 ,   999820.45,
          999851.4 ,   999743.15,   999824.6 ,   999780.05,   999731.8 ],
       [  999931.1 ,  1000181.  ,  1000101.35,  1000083.65,  1000170.15,
         1000343.85,  1000316.55,  1000421.05,  1000372.55,  1000259.15,
         1000353.8 ,  1000302.85,  1000314.35,  1000124.4 ,   999937.4 ,
          999875.8 ,   999891.  ,   999850.35,   999654.15,   999710.95,
          999677.5 ,   999645.9 ,   999635.75,   999796.95,   999714.35,
          999769.1 ,   999854.3 ,   999805.5 ,   999752.05,   999780.95],
       [ 1000127.4 ,  1000072.5 ,  1000096.15,  1000112.2 ,  1000394.  ,
         1000363.35,  1000380.3 ,  1000483.25,  1000267.75,  1000126.9 ,
         1000215.3 ,  1000138.9 ,   999937.2 ,   999957.9 ,   999863.  ,
          999905.25,   999823.3 ,   999665.9 ,   999680.25,   999665.8 ,
          999644.9 ,   999644.6 ,   999754.6 ,   999654.7 ,   999798.7 ,
          999827.25,   999828.4 ,   999779.75,   999799.55,  1000002.  ],
       [  999986.1 ,  1000079.15,  1000001.6 ,  1000277.35,  1000372.7 ,
         1000467.5 ,  1000524.5 ,  1000398.  ,  1000027.15,  1000269.95,
         1000190.15,   999902.95,   999904.7 ,   999873.65,   999884.55,
          999830.15,   999641.  ,   999670.05,   999634.05,   999646.1 ,
          999608.7 ,   999737.15,   999649.9 ,   999669.1 ,   999781.35,
          999794.7 ,   999818.8 ,   999859.4 ,   999975.1 ,   999968.65],
       [ 1000157.05,   999993.3 ,  1000081.7 ,  1000455.75,  1000439.1 ,
         1000577.3 ,  1000469.2 ,  1000354.65,  1000120.35,  1000177.75,
         1000089.45,   999829.5 ,   999894.35,   999919.9 ,   999644.5 ,
          999635.4 ,   999639.75,   999605.1 ,   999637.05,   999621.45,
          999630.8 ,   999776.55,   999670.6 ,   999725.4 ,   999786.8 ,
          999788.5 ,   999818.4 ,  1000014.  ,  1000018.8 ,   999838.9 ],
       [ 1000035.55,  1000084.15,  1000477.55,  1000625.65,  1000549.45,
         1000359.85,  1000418.65,  1000150.7 ,  1000220.3 ,  1000279.9 ,
          999977.  ,   999968.4 ,   999926.7 ,   999745.15,   999668.35,
          999667.95,   999652.95,   999668.85,   999688.55,   999680.85,
          999854.7 ,   999837.1 ,   999778.45,   999850.7 ,   999854.3 ,
          999919.55,  1000000.75,  1000039.45,   999872.25,   999642.2 ],
       [ 1000191.45,  1000476.5 ,  1000654.2 ,  1000547.75,  1000445.6 ,
         1000411.55,  1000332.75,  1000236.3 ,  1000121.3 ,  1000160.85,
          999919.8 ,   999741.05,   999729.7 ,   999731.3 ,   999716.95,
          999647.75,   999730.3 ,   999741.  ,   999686.6 ,   999830.65,
          999856.45,   999704.85,   999861.  ,   999854.  ,   999862.2 ,
          999844.9 ,   999845.2 ,   999666.4 ,   999833.45,   999831.85],
       [ 1000397.65,  1000415.45,  1000539.2 ,  1000344.25,  1000442.3 ,
         1000296.1 ,  1000229.85,  1000094.55,  1000081.85,   999796.95,
          999728.45,   999753.25,   999734.25,   999709.75,   999690.1 ,
          999726.1 ,   999723.15,   999725.85,   999727.7 ,   999841.7 ,
          999683.1 ,   999758.45,   999850.1 ,   999808.6 ,   999608.55,
          999892.9 ,   999662.85,   999662.1 ,   999826.5 ,   999823.85],
       [ 1000359.2 ,  1000415.1 ,  1000338.  ,  1000370.6 ,  1000260.  ,
         1000214.6 ,   999855.55,   999849.35,   999768.1 ,   999800.4 ,
          999744.7 ,   999724.35,   999682.95,   999666.2 ,   999699.1 ,
          999656.7 ,   999711.7 ,   999678.2 ,   999681.15,   999938.35,
          999767.5 ,   999805.95,   999576.  ,   999543.65,   999670.1 ,
          999543.65,   999584.5 ,   999668.7 ,   999760.1 ,   999775.15],
       [ 1000468.25,  1000312.3 ,  1000303.  ,  1000302.15,  1000163.45,
         1000075.95,   999776.2 ,   999953.75,   999800.45,   999788.05,
          999705.5 ,   999654.8 ,   999710.4 ,   999693.9 ,   999686.65,
          999682.9 ,   999739.75,   999630.25,   999728.  ,   999558.6 ,
          999603.6 ,   999544.25,   999470.35,   999504.45,   999668.6 ,
          999690.95,   999694.35,   999772.45,   999839.15,   999994.85],
       [ 1000535.45,  1000398.75,  1000423.05,  1000265.9 ,  1000034.7 ,
          999703.55,   999825.9 ,   999971.7 ,   999735.1 ,   999715.25,
          999683.35,   999729.45,   999714.35,   999674.5 ,   999638.85,
          999558.3 ,   999603.45,   999727.15,   999550.95,   999562.15,
          999542.35,   999500.55,   999487.05,   999717.5 ,   999642.8 ,
          999587.3 ,   999781.25,   999840.35,  1000001.2 ,   999839.1 ],
       [ 1000333.45,  1000331.1 ,  1000228.2 ,  1000104.7 ,   999671.9 ,
          999759.05,   999981.55,   999769.5 ,   999752.1 ,   999690.15,
          999722.4 ,   999736.5 ,   999665.2 ,   999447.05,   999631.35,
          999625.95,   999714.1 ,   999730.85,   999539.8 ,   999522.1 ,
          999530.95,   999502.9 ,   999725.3 ,   999597.15,   999627.85,
          999739.25,   999853.95,  1000032.15,   999866.75,  1000055.9 ],
       [ 1000219.55,  1000097.4 ,  1000162.35,   999625.9 ,   999718.8 ,
          999975.8 ,   999803.5 ,   999769.95,   999744.4 ,   999758.75,
          999695.25,   999649.75,   999477.85,   999652.4 ,   999552.85,
          999774.95,   999734.95,   999506.3 ,   999530.15,   999538.65,
          999548.  ,   999720.05,   999620.2 ,   999749.5 ,   999582.2 ,
          999842.8 ,  1000014.65,   999871.15,  1000226.2 ,  1000067.8 ],
       [ 1000029.55,  1000179.8 ,   999632.4 ,   999701.55,   999996.85,
          999797.45,   999768.75,   999737.4 ,   999751.45,   999687.35,
          999680.  ,   999503.75,   999634.85,   999554.2 ,   999597.4 ,
          999755.1 ,   999488.75,   999541.4 ,   999533.6 ,   999599.55,
          999594.55,   999774.55,   999587.15,   999572.5 ,   999663.15,
         1000016.8 ,   999857.6 ,  1000076.1 ,  1000051.9 ,  1000042.85],
       [ 1000110.75,   999609.05,   999766.7 ,   999927.6 ,   999810.55,
          999716.45,   999731.4 ,   999772.9 ,   999744.45,   999690.7 ,
          999546.4 ,   999664.55,   999670.2 ,   999576.8 ,   999757.1 ,
          999562.9 ,   999523.05,   999555.75,   999567.3 ,   999557.55,
          999770.7 ,   999429.4 ,   999588.6 ,   999692.95,   999837.9 ,
         1000234.65,  1000218.3 ,  1000044.85,  1000048.85,   999917.3 ],
       [  999831.7 ,   999587.85,   999815.45,  1000043.9 ,   999727.5 ,
          999745.3 ,   999819.95,   999767.7 ,   999731.6 ,   999771.65,
          999716.05,   999678.35,   999631.65,   999712.7 ,   999570.1 ,
          999596.25,   999586.7 ,   999541.6 ,   999402.3 ,   999426.65,
          999453.85,   999581.25,   999571.6 ,   999771.7 ,  1000226.6 ,
         1000193.1 ,  1000064.3 ,  1000046.35,   999909.55,   999918.75],
       [  999691.45,   999630.6 ,   999774.  ,   999828.05,   999842.35,
          999827.55,   999796.25,   999755.1 ,   999796.25,   999701.85,
          999686.35,   999637.5 ,   999798.55,   999575.8 ,   999624.7 ,
          999485.  ,   999539.9 ,   999373.95,   999424.35,   999603.75,
          999606.85,   999832.35,   999981.4 ,  1000231.35,  1000238.2 ,
         1000073.1 ,  1000048.45,   999912.4 ,   999746.3 ,   999771.45],
       [  999652.2 ,   999860.5 ,   999799.3 ,   999837.85,   999775.75,
          999833.15,   999908.9 ,   999854.05,   999755.1 ,   999692.45,
          999676.1 ,   999890.25,   999723.3 ,   999519.7 ,   999429.25,
          999353.25,   999383.  ,   999646.45,   999695.9 ,   999739.8 ,
          999879.7 ,  1000201.  ,  1000259.85,  1000273.85,  1000268.4 ,
          999969.7 ,  1000098.3 ,   999773.3 ,   999987.05,   999991.5 ]])

In [49]:
X = np.arange(0, 30)
Y = np.arange(0, 30)
X, Y = np.meshgrid(X, Y) 
fig = plt.figure(figsize=(10,10))
ax = fig.gca(projection='3d')
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap='hot', linewidth=0, antialiased=False)



In [37]:
X = np.arange(0, 20)
len(X)


Out[37]:
20

In [50]:
import scipy.io
scipy.io.savemat('Z2.mat', mdict={'Z': Z})

In [ ]: