quantopian / zipline

Zipline, a Pythonic Algorithmic Trading Library
https://www.zipline.io
Apache License 2.0
17.52k stars 4.71k forks source link

order_target_percent doesn't execute orders #2197

Open Kiminaka opened 6 years ago

Kiminaka commented 6 years ago

Dear Zipline Maintainers,

Before I tell you about my issue, let me describe my environment:

Environment

Now that you know a little about me, let me tell you about the issue I am having: order_target_percent doesn't execute orders

Description of Issue

I was trying to follow Zipline's moving average crossover example with a custom csv dataset that's been already put into a custom data bundle using register and csvdir.csvdir_equities. I used order_target_percent(context.asset, 1.0) or order_target_percent(context.asset, 0.0) to order an asset and the code went through seemed successfully but when I take a look at the performance result, it didn't execute any orders.

Here is how you can reproduce this issue on your machine:

code

from zipline.api import (history, 
                         set_slippage, 
                         slippage,
                         set_commission, 
                         commission, 
                         order_target_percent,
                         order_target_value,                         
                        record,
                         set_benchmark,
                         get_open_orders,
                        symbol)
from zipline.finance.slippage import VolumeShareSlippage,FixedBasisPointsSlippage
ticker = 'btc'
def initialize(context):
    #set_slippage( FixedBasisPointsSlippage(basis_points=0.0, volume_limit = 1.0))
    set_slippage(slippage.FixedSlippage(spread=0.0))
    set_commission(commission.PerShare(cost=0.0, min_trade_cost=0.0))
    context.i = 0
    context.asset = symbol(ticker)

def handle_data(context, data):

    # Skip first 30days to get full windows
    context.i += 1
    if context.i < 30:
        return

    short_ma = data.history(context.asset, 'price', bar_count=3, frequency="1d").mean()
    long_ma = data.history(context.asset, 'price', bar_count=14, frequency="1d").mean()

    # Trading logic
    if short_ma > long_ma:
        order_target_percent(context.asset, 1.0)
    elif short_ma < long_ma:
        order_target_percent(context.asset, -1.0)

    record(price=data.current(context.asset, 'price'),
           volume=data.current(context.asset, 'volume'),
           short_mavg=short_ma,
           long_mavg=long_ma)

def analyze(context, perf):
    fig = plt.figure(figsize=(15,10))
    ax1 = fig.add_subplot(211)
    perf.portfolio_value.plot(ax=ax1)
    ax1.set_ylabel('portfolio value in $')

    ax2 = fig.add_subplot(212)
    print(perf.columns)
    perf['price'].plot(ax=ax2)
    perf[['short_mavg', 'long_mavg']].plot(ax=ax2)

    perf_trans = perf.ix[[t != [] for t in perf.transactions]]
    buys = perf_trans.ix[[t[0]['amount'] > 0 for t in perf_trans.transactions]]
    sells = perf_trans.ix[[t[0]['amount'] < 0 for t in perf_trans.transactions]]

    ax2.plot(buys.index, perf.short_mavg.ix[buys.index],
             '^', markersize=5, color='m')    
    ax2.plot(sells.index, perf.short_mavg.ix[sells.index],
             'v', markersize=5, color='k')

    ax2.set_ylabel('price in $')
    plt.legend(loc=0)
    plt.show()

base_capital = 1000
start = datetime.datetime(2017, 12, 1, 0, 0, 0, 0, pytz.utc)
end = datetime.datetime(2018, 5, 1, 0, 0, 0, 0, pytz.utc)
# run the trading algorithm and save the results in perf
perf = run_algorithm(start, end, initialize, base_capital, handle_data, data_frequency='daily', analyze=analyze, bundle = 'test')

price data set example (csv)

date | open | high | low | close | volume | dividend | split
-- | -- | -- | -- | -- | -- | -- | --
2017/11/3 |   | 7326.3 | 6769.12 | 7013.75 | 1000000 | 0 | 1
2017/11/4 | 7013.75 | 7397 | 6923.79 | 7122.85 | 1000000 | 0 | 1
2017/11/5 | 7017.2 | 7399.95 | 6946.3 | 7365.94 | 1000000 | 0 | 1
2017/11/6 | 7100.3 | 7585.9 | 7276.2 | 7372.37 | 1000000 | 0 | 1
2017/11/7 | 7323.83 | 7412.91 | 6926.65 | 6936.82 | 1000000 | 0 | 1
2017/11/8 | 7369.6 | 7214.9 | 6955.43 | 7085.18 | 1000000 | 0 | 1
2017/11/9 | 7056.93 | 7412.04 | 7058.62 | 7381.75 | 1000000 | 0 | 1
2017/11/10 | 7074.78 | 7379.89 | 7022.03 | 7123.2 | 1000000 | 0 | 1
2017/11/11 | 7123.2 | 7288.71 | 6333.45 | 6539.85 | 1000000 | 0 | 1
2017/11/12 | 7113.55 | 6798.23 | 6170.01 | 6309.84 | 1000000 | 0 | 1
2017/11/13 | 6514.9 | 6417 | 5464.76 | 6394.14 | 1000000 | 0 | 1
2017/11/14 | 6292.27 | 6719.82 | 6140 | 6486.12 | 1000000 | 0 | 1
2017/11/15 | 6486.12 | 6684.88 | 6312.11 | 6569.16 | 1000000 | 0 | 1
2017/11/16 | 6479.11 | 7295.99 | 6571.9 | 7278.89 | 1000000 | 0 | 1
2017/11/17 | 6573.06 | 7985.03 | 7094 | 7865.06 | 1000000 | 0 | 1
2017/11/18 | 7268.37 | 7999.95 | 7503.88 | 7680.25 | 1000000 | 0 | 1
2017/11/19 | 7866.11 | 7866.58 | 7420.76 | 7772.9 | 1000000 | 0 | 1
2017/11/20 | 7676.02 | 8099.97 | 7657.71 | 8054.08 | 1000000 | 0 | 1
2017/11/21 | 7776.57 | 8300.996667 | 7974.386667 | 8246.803333 | 1000000 | 0 | 1
2017/11/22 | 8186.193333 | 8317.116667 | 7783.236667 | 8153.503333 | 1000000 | 0 | 1
2017/11/23 | 8259.14 | 8298.98 | 8103.13 | 8250 | 1000000 | 0 | 1
2017/11/24 | 8110.73 | 8274.98 | 8031.16 | 8031.16 | 1000000 | 0 | 1
2017/11/25 | 8250 | 8324 | 7900.02 | 8215.01 | 1000000 | 0 | 1
2017/11/26 | 8015 | 8782.75 | 8306.64 | 8773.85 | 1000000 | 0 | 1
2017/11/27 | 8483.585 | 9545.2 | 8777.25 | 9351.905 | 1000000 | 0 | 1
2017/11/28 | 8777.55 | 9782.5 | 9327.555 | 9748.555 | 1000000 | 0 | 1
2017/11/29 | 9357.15 | 9983.858094 | 9657.21 | 9920.55 | 1000000 | 0 | 1
2017/11/30 | 9748.695 | 11459.03 | 8800.55 | 9847.69 | 1000000 | 0 | 1
2017/12/1 | 9919.665 | 10696 | 8978.955 | 9905 | 1000000 | 0 | 1
2017/12/2 | 9868.345249 | 10943 | 9443.55 | 10869.42 | 1000000 | 0 | 1
2017/12/3 | 9931.8 | 11144 | 10671.335 | 10906.17 | 1000000 | 0 | 1
2017/12/4 | 10854.425 | 11866.5 | 10439.015 | 11223.495 | 1000000 | 0 | 1
2017/12/5 | 10900.105 | 11618.125 | 10841.49 | 11617.6 | 1000000 | 0 | 1
2017/12/6 | 11221.5 | 11903.5 | 11474.5 | 11655.175 | 1000000 | 0 | 1
2017/12/7 | 11637.5 | 13974.5 | 11653.755 | 13799.5 | 1000000 | 0 | 1
2017/12/8 | 11663.995 | 18074.495 | 13357.17 | 16999.5 | 1000000 | 0 | 1
2017/12/9 | 13800.5 | 17471.5 | 13776 | 16109.015 | 1000000 | 0 | 1
2017/12/10 | 16999.505 | 16399.5 | 13292.5 | 14984.99 | 1000000 | 0 | 1
2017/12/11 | 16093 | 15990.2 | 13116 | 15077.5 | 1000000 | 0 | 1
2017/12/12 | 14938.975 | 17466.5 | 15073.305 | 16817.38 | 1000000 | 0 | 1
2017/12/13 | 15200.495 | 17863.945 | 16305 | 17348.56 | 1000000 | 0 | 1
2017/12/14 | 16822.845 | 17594 | 15670.5 | 16434.305 | 1000000 | 0 | 1
2017/12/15 | 17349.06 | 17099.3 | 16066.63 | 16566.895 | 1000000 | 0 | 1
2017/12/16 | 16415.5 | 17998.5 | 16548.5 | 17630.335 | 1000000 | 0 | 1
2017/12/17 | 16567.5 | 19672.5 | 17364 | 19418.59 | 1000000 | 0 | 1
2017/12/18 | 17639.5 | 19891.495 | 18827 | 19172.495 | 1000000 | 0 | 1
2017/12/19 | 19420 | 19278 | 18112.635 | 18985 | 1000000 | 0 | 1
2017/12/20 | 19143.04583 | 19043 | 16716 | 17591.865 | 1000000 | 0 | 1
2017/12/21 | 18976.5 | 17798.995 | 14903 | 16460.95 | 1000000 | 0 | 1
2017/12/22 | 17553.505 | 17345.35 | 14992.02 | 15712.81243 | 1000000 | 0 | 1
2017/12/23 | 16468.45 | 15879.905 | 10559 | 13690.285 | 1000000 | 0 | 1
2017/12/24 | 15791.31 | 15623.5 | 13257.725 | 14555.445 | 1000000 | 0 | 1
2017/12/25 | 13743.995 | 14573.495 | 12405.59925 | 13850.47 | 1000000 | 0 | 1
2017/12/26 | 14484.705 | 14526 | 13139 | 13899.49 | 1000000 | 0 | 1
2017/12/27 | 13902.5 | 16097.475 | 13860.995 | 15734.94 | 1000000 | 0 | 1
2017/12/28 | 13903.995 | 16492 | 14499.295 | 15370.535 | 1000000 | 0 | 1
2017/12/29 | 15711 | 15478 | 13366.005 | 14378.005 | 1000000 | 0 | 1
2017/12/30 | 15393.905 | 15103.8 | 13944.405 | 14441.025 | 1000000 | 0 | 1
2017/12/31 | 14422.5 | 14521.385 | 12095 | 12608.495 | 1000000 | 0 | 1
2018/1/1 | 14409.005 | 14207.995 | 12420.92357 | 13310.58 | 1000000 | 0 | 1
2018/1/2 | 12593 | 13891 | 12869.75 | 13434.005 | 1000000 | 0 | 1
2018/1/3 | 13809.89 | 15287.5 | 12912.9 | 14747.26 | 1000000 | 0 | 1
2018/1/4 | 13457.2 | 15414 | 14575.005 | 15124.07 | 1000000 | 0 | 1
2018/1/5 | 14743.505 | 15395 | 14150.09 | 15151.995 | 1000000 | 0 | 1
2018/1/6 | 15118.5 | 17139.5 | 14796.525 | 16938.505 | 1000000 | 0 | 1
2018/1/7 | 15151.935 | 17213 | 16251.005 | 17130 | 1000000 | 0 | 1
2018/1/8 | 16930 | 17145.505 | 15744.34 | 16185.11 | 1000000 | 0 | 1
2018/1/9 | 17142.495 | 16277 | 13880 | 14961.87 | 1000000 | 0 | 1
2018/1/10 | 16177.11 | 15369.5 | 14176.005 | 14453.495 | 1000000 | 0 | 1
2018/1/11 | 14943.615 | 14884.5 | 13444.005 | 14884 | 1000000 | 0 | 1
2018/1/12 | 14479.445 | 14959.90133 | 12755.995 | 13288 | 1000000 | 0 | 1
2018/1/13 | 14894.995 | 14087.915 | 12849.005 | 13801.5 | 1000000 | 0 | 1
2018/1/14 | 13262 | 14540 | 13776.125 | 14189.475 | 1000000 | 0 | 1
2018/1/15 | 13833.495 | 14361.925 | 12992.17106 | 13606.115 | 1000000 | 0 | 1
2018/1/16 | 14188.5 | 14301.5 | 13361.5 | 13592 | 1000000 | 0 | 1
2018/1/17 | 13598.66053 | 13623.145 | 9974.705 | 11321.005 | 1000000 | 0 | 1
2018/1/18 | 13621.145 | 11924.445 | 9138.355 | 11141.005 | 1000000 | 0 | 1
2018/1/19 | 11339.5 | 12001.75 | 10601.11 | 11175.265 | 1000000 | 0 | 1
2018/1/20 | 11144.88806 | 11926.495 | 10849.5 | 11487.495 | 1000000 | 0 | 1
2018/1/21 | 11118.63292 | 12993.035 | 11461.995 | 12745.4 | 1000000 | 0 | 1
2018/1/22 | 11492 | 12747.4 | 11069 | 11516.085 | 1000000 | 0 | 1
2018/1/23 | 12746.9 | 11867.5 | 10017.5 | 10768.35 | 1000000 | 0 | 1
2018/1/24 | 11518.285 | 11376.005 | 9925.69 | 10817.97 | 1000000 | 0 | 1
2018/1/25 | 10800.99 | 11485.765 | 10452 | 11379.395 | 1000000 | 0 | 1
2018/1/26 | 10880.72 | 11706.5 | 10854 | 11132 | 1000000 | 0 | 1
2018/1/27 | 11332.755 | 11608.5 | 10312.465 | 11077.445 | 1000000 | 0 | 1
2018/1/28 | 11110.015 | 11588.235 | 10836 | 11387.0663 | 1000000 | 0 | 1
2018/1/29 | 11084.12597 | 11937.99 | 11316.5 | 11687.5 | 1000000 | 0 | 1
2018/1/30 | 11395.5 | 11763.5 | 10960.395 | 11169.005 | 1000000 | 0 | 1
2018/1/31 | 11678.5 | 11200 | 9788.005 | 10082.495 | 1000000 | 0 | 1
2018/2/1 | 11179 | 10355.475 | 9681.01 | 10188.995 | 1000000 | 0 | 1
2018/2/2 | 10071.055 | 10236.565 | 8670.5 | 9097.61 | 1000000 | 0 | 1
2018/2/3 | 10182.99 | 9145.54 | 7756.1 | 8837.31 | 1000000 | 0 | 1
2018/2/4 | 9096.28 | 9496.995 | 8156.85 | 9226.434633 | 1000000 | 0 | 1
2018/2/5 | 8856.445 | 9376.65 | 7850 | 8183.955 | 1000000 | 0 | 1
2018/2/6 | 9172.825 | 8363.58 | 6551.63 | 6927.55 | 1000000 | 0 | 1
2018/2/7 | 8203.59 | 7902.32 | 5936.5 | 7681.13 | 1000000 | 0 | 1
2018/2/8 | 6985 | 8569.1 | 7194.79 | 7581.375 | 1000000 | 0 | 1
2018/2/9 | 7697.2 | 8636.9 | 7572.29 | 8226.6 | 1000000 | 0 | 1
2018/2/10 | 7590.505 | 8724 | 7742.35 | 8674.555 | 1000000 | 0 | 1
2018/2/11 | 8234.475 | 9067.145 | 8153.55 | 8555.295 | 1000000 | 0 | 1
2018/2/12 | 8662.94 | 8558.24 | 7854.39 | 8071.495 | 1000000 | 0 | 1
2018/2/13 | 8555.155 | 8975 | 8071.495 | 8887.59 | 1000000 | 0 | 1
2018/2/14 | 8107.94 | 8938.9 | 8366.4 | 8517.955 | 1000000 | 0 | 1
2018/2/15 | 8890.945 | 9485.25 | 8516.3 | 9463.64 | 1000000 | 0 | 1
2018/2/16 | 8523.505 | 10212.405 | 9341.07 | 10013.615 | 1000000 | 0 | 1
2018/2/17 | 9452.215 | 10288.84 | 9702.55 | 10164.745 | 1000000 | 0 | 1
2018/2/18 | 10002.345 | 11116 | 10053.5 | 11087.47944 | 1000000 | 0 | 1
2018/2/19 | 10163.245 | 11274.55 | 10140.5 | 10376.02 | 1000000 | 0 | 1
2018/2/20 | 11080.705 | 11260.995 | 10303.405 | 11156.5 | 1000000 | 0 | 1
2018/2/21 | 10376.05 | 11767.62 | 11050.505 | 11225.785 | 1000000 | 0 | 1
2018/2/22 | 11150.5 | 11258.74 | 10225 | 10454.635 | 1000000 | 0 | 1
2018/2/23 | 10454.68831 | 10754.77237 | 9966.507046 | 10032.62371 | 1000000 | 0 | 1
2018/2/24 | 9827.99664 | 10204.5395 | 9656.305223 | 10032.85283 | 1000000 | 0 | 1
2018/2/25 | 10144.9958 | 10379.33247 | 9620.179534 | 9830.813735 | 1000000 | 0 | 1
2018/2/26 | 9675.685963 | 9787.379297 | 9417.744009 | 9608.390675 | 1000000 | 0 | 1
2018/2/27 | 9589.378637 | 10157.87612 | 9448.419513 | 10068.106 | 1000000 | 0 | 1
2018/2/28 | 10311.9418 | 10684.77351 | 10193.97883 | 10484.3762 | 1000000 | 0 | 1
2018/3/1 | 10563.43209 | 10895.10394 | 10364.33385 | 10396.83364 | 1000000 | 0 | 1
2018/3/2 | 10311.62311 | 10824.44292 | 10249.04635 | 10711.69072 | 1000000 | 0 | 1
2018/3/3 | 10915.08988 | 11085.78426 | 10814.39679 | 10979.52178 | 1000000 | 0 | 1
2018/3/4 | 11013.96532 | 11350.41308 | 11013.4067 | 11301.32975 | 1000000 | 0 | 1
2018/3/5 | 11436.74788 | 11519.28389 | 11055.6882 | 11487.51454 | 1000000 | 0 | 1
2018/3/6 | 11488.19995 | 11674.59798 | 11395.80735 | 11437.66772 | 1000000 | 0 | 1
2018/3/7 | 11445.47191 | 11445.47191 | 10572.79227 | 10707.99932 | 1000000 | 0 | 1
2018/3/8 | 10707.93745 | 10896.8348 | 9774.154297 | 10111.5824 | 1000000 | 0 | 1
2018/3/9 | 9916.904224 | 10104.22752 | 9055.660395 | 9302.125923 | 1000000 | 0 | 1
2018/3/10 | 9302.05304 | 9416.100628 | 8361.068277 | 9233.491198 | 1000000 | 0 | 1
2018/3/11 | 9233.46368 | 9508.132191 | 8713.560873 | 8777.289037 | 1000000 | 0 | 1
2018/3/12 | 8777.305006 | 9736.876346 | 8465.170604 | 9530.44381 | 1000000 | 0 | 1
2018/3/13 | 9530.42324 | 9892.765203 | 8778.320707 | 9120.129371 | 1000000 | 0 | 1
2018/3/14 | 9120.586841 | 9476.471464 | 8840.21873 | 9139.367656 | 1000000 | 0 | 1
2018/3/15 | 9139.346974 | 9375.689309 | 7926.728471 | 8194.893949 | 1000000 | 0 | 1
2018/3/16 | 8195.191267 | 8409.673842 | 7666.173782 | 8254.950502 | 1000000 | 0 | 1
2018/3/17 | 8254.231795 | 8601.572007 | 7906.462823 | 8261.622969 | 1000000 | 0 | 1
2018/3/18 | 8260.258369 | 8348.331457 | 7738.322197 | 7849.518264 | 1000000 | 0 | 1
2018/3/19 | 7853.680178 | 8291.853748 | 7269.9652 | 8196.870082 | 1000000 | 0 | 1
2018/3/20 | 8196.768081 | 8709.068523 | 8103.477957 | 8595.538695 | 1000000 | 0 | 1
2018/3/21 | 8595.441639 | 9033.922229 | 8312.701377 | 8899.859235 | 1000000 | 0 | 1
2018/3/22 | 8899.884929 | 9171.522577 | 8755.402749 | 8892.746362 | 1000000 | 0 | 1
2018/3/23 | 8890.548054 | 8971.729305 | 8665.71403 | 8764.643743 | 1000000 | 0 | 1
2018/3/24 | 8708.376018 | 8915.603792 | 8275.734488 | 8913.604237 | 1000000 | 0 | 1
2018/3/25 | 8914.775662 | 9022.989318 | 8481.798075 | 8529.795086 | 1000000 | 0 | 1
2018/3/26 | 8527.56083 | 8672.324726 | 8367.745049 | 8448.254782 | 1000000 | 0 | 1
2018/3/27 | 8448.275292 | 8497.055058 | 7846.87504 | 8129.460916 | 1000000 | 0 | 1
2018/3/28 | 8132.879245 | 8212.795433 | 7739.553802 | 7788.641612 | 1000000 | 0 | 1
2018/3/29 | 7788.233966 | 8105.703734 | 7727.045279 | 7938.813376 | 1000000 | 0 | 1
2018/3/30 | 7938.832937 | 7961.05147 | 6901.304455 | 7086.400148 | 1000000 | 0 | 1
2018/3/31 | 7086.306509 | 7270.692441 | 6561.235223 | 6843.607016 | 1000000 | 0 | 1
2018/4/1 | 6843.477386 | 7212.98436 | 6787.793085 | 6925.76185 | 1000000 | 0 | 1
2018/4/2 | 6926.619546 | 7038.782242 | 6439.323873 | 6812.364345 | 1000000 | 0 | 1
2018/4/3 | 6812.44295 | 7112.701309 | 6773.077885 | 7052.185646 | 1000000 | 0 | 1
2018/4/4 | 7052.09806 | 7513.898607 | 7018.758824 | 7413.588233 | 1000000 | 0 | 1
2018/4/5 | 7413.80638 | 7423.236694 | 6686.790993 | 6788.468067 | 1000000 | 0 | 1
2018/4/6 | 6788.195228 | 6915.928955 | 6572.755439 | 6774.229949 | 1000000 | 0 | 1
2018/4/7 | 6773.619899 | 6849.640482 | 6508.451295 | 6614.455703 | 1000000 | 0 | 1
2018/4/8 | 6613.614032 | 7068.817728 | 6601.977768 | 6893.172061 | 1000000 | 0 | 1
2018/4/9 | 6893.17837 | 7108.860348 | 6886.541332 | 7022.372545 | 1000000 | 0 | 1
2018/4/10 | 7022.434983 | 7180.390763 | 6614.534036 | 6768.582631 | 1000000 | 0 | 1
2018/4/11 | 6770.988561 | 6888.690155 | 6654.308703 | 6833.789943 | 1000000 | 0 | 1
2018/4/12 | 6833.467741 | 6974.311703 | 6799.487293 | 6943.055168 | 1000000 | 0 | 1
2018/4/13 | 6943.055381 | 8070.030384 | 6763.924404 | 7913.622506 | 1000000 | 0 | 1
2018/4/14 | 7913.664105 | 8224.029418 | 7751.824369 | 7887.621233 | 1000000 | 0 | 1
2018/4/15 | 7888.927438 | 8168.457645 | 7824.635747 | 8003.022205 | 1000000 | 0 | 1
2018/4/16 | 8002.988248 | 8412.121507 | 7999.683548 | 8354.816596 | 1000000 | 0 | 1
2018/4/17 | 8354.985522 | 8404.281322 | 7902.645818 | 8053.202795 | 1000000 | 0 | 1
2018/4/18 | 8053.138392 | 8165.243529 | 7822.752532 | 7890.459817 | 1000000 | 0 | 1
2018/4/19 | 7890.202276 | 8227.742201 | 7874.451869 | 8160.302224 | 1000000 | 0 | 1
2018/4/20 | 8160.321904 | 8298.155394 | 8102.06016 | 8273.307371 | 1000000 | 0 | 1
2018/4/21 | 8273.316031 | 8932.576204 | 8217.800228 | 8865.773156 | 1000000 | 0 | 1
2018/4/22 | 8865.761718 | 9033.994172 | 8615.490708 | 8916.694452 | 1000000 | 0 | 1
2018/4/23 | 8916.700909 | 9027.691578 | 8754.301288 | 8795.075323 | 1000000 | 0 | 1
2018/4/24 | 8792.84265 | 9000.660744 | 8771.978055 | 8936.49655 | 1000000 | 0 | 1
2018/4/25 | 8936.355052 | 9733.986918 | 8929.941896 | 9646.626605 | 1000000 | 0 | 1
2018/4/26 | 9644.651291 | 9762.33345 | 8699.964998 | 8866.863395 | 1000000 | 0 | 1
2018/4/27 | 8866.841709 | 9312.330862 | 8657.736676 | 9285.409857 | 1000000 | 0 | 1
2018/4/28 | 9285.383358 | 9376.016498 | 8905.824894 | 8921.10465 | 1000000 | 0 | 1
2018/4/29 | 8921.150483 | 9426.931547 | 8853.796337 | 9338.735555 | 1000000 | 0 | 1
2018/4/30 | 9339.359209 | 9544.077479 | 9182.811166 | 9398.20876 | 1000000 | 0 | 1
2018/5/1 | 9398.763363 | 9447.471965 | 9115.919432 | 9241.796779 | 1000000 | 0 | 1
2018/5/2 | 9242.03398 | 9242.553934 | 8829.999265 | 9069.255483 | 1000000 | 0 | 1
2018/5/3 | 9069.305742 | 9266.815489 | 8984.133028 | 9216.060793 | 1000000 | 0 | 1
2018/5/4 | 9216.436367 | 9817.171219 | 9148.979358 | 9745.259226 | 1000000 | 0 | 1
2018/5/5 | 9744.689744 | 9783.115991 | 9517.416609 | 9695.482144 | 1000000 | 0 | 1
2018/5/6 | 9695.105264 | 9971.76293 | 9675.370574 | 9833.645555 | 1000000 | 0 | 1
2018/5/7 | 9834.938465 | 9929.18351 | 9428.104031 | 9634.410871 | 1000000 | 0 | 1
2018/5/8 | 9634.79807 | 9652.836399 | 9186.562799 | 9364.427114 | 1000000 | 0 | 1
2018/5/9 | 9364.142029 | 9466.900955 | 9051.665209 | 9181.788687 | 1000000 | 0 | 1
2018/5/10 | 9181.783159 | 9370.51899 | 8971.590784 | 9310.966986 | 1000000 | 0 | 1
2018/5/11 | 9310.490538 | 9388.430027 | 9002.153321 | 9015.238624 | 1000000 | 0 | 1
2018/5/12 | 9015.306733 | 9015.306733 | 8345.611729 | 8406.084666 | 1000000 | 0 | 1
2018/5/13 | 8408.641837 | 8641.026484 | 8212.994194 | 8466.879503 | 1000000 | 0 | 1
2018/5/14 | 8467.772691 | 8761.623575 | 8330.310348 | 8684.631035 | 1000000 | 0 | 1
2018/5/15 | 8684.62175 | 8881.41912 | 8283.79135 | 8670.70956 | 1000000 | 0 | 1
2018/5/16 | 8670.689824 | 8841.460691 | 8422.915012 | 8471.734458 | 1000000 | 0 | 1
2018/5/17 | 8471.793965 | 8493.571668 | 8104.199258 | 8339.483279 | 1000000 | 0 | 1
2018/5/18 | 8339.389562 | 8472.996099 | 7992.712883 | 8053.047282 | 1000000 | 0 | 1
2018/5/19 | 8053.05605 | 8277.864297 | 7927.553817 | 8238.795543 | 1000000 | 0 | 1
2018/5/20 | 8238.794183 | 8395.85764 | 8146.431376 | 8233.686118 | 1000000 | 0 | 1
2018/5/21 | 8233.651707 | 8586.680708 | 8171.811302 | 8520.756409 | 1000000 | 0 | 1
2018/5/22 | 8520.908209 | 8585.871446 | 8314.912291 | 8393.416326 | 1000000 | 0 | 1
2018/5/23 | 8393.416394 | 8403.836004 | 7948.351666 | 7982.255811 | 1000000 | 0 | 1
2018/5/24 | 7981.6387 | 8024.171826 | 7438.382903 | 7499.448516 | 1000000 | 0 | 1
2018/5/25 | 7499.138415 | 7725.226438 | 7266.432203 | 7579.868744 | 1000000 | 0 | 1
2018/5/26 | 7579.746062 | 7657.264634 | 7325.242465 | 7458.453843 | 1000000 | 0 | 1
2018/5/27 | 7458.462964 | 7624.903208 | 7289.81205 | 7333.490695 | 1000000 | 0 | 1
2018/5/28 | 7333.484167 | 7403.674857 | 7224.224849 | 7342.588643 | 1000000 | 0 | 1

Sincerely, $ whoami

Kiminaka commented 6 years ago

anyone?

grananqvist commented 6 years ago

I'm also having trouble with no transactions recorded when using custom bundle. Whenever I backtest with the same code and quantopian-quadl bundle instead, it works.

choutomi commented 3 months ago

I'm having the same issue as well with a custom bundle. This applies primarily for non-standard symbols. In my case it was BRK.A because the . interferes with the custom bundle ingestion so I changed the symbol to BRK-A. For some reason, it works with order()