Re: Zipline ingest reading wrong data

111 views
Skip to first unread message
Message has been deleted

Freddie Vargus

unread,
Oct 5, 2018, 2:11:12 PM10/5/18
to Mosfiqur Rahman, Zipline Python Opensource Backtester
Hi Mosfiqur,

I believe there is a fix on GitHub that is yet to be merged: https://github.com/quantopian/zipline/pull/2223.

Once that is merged, if you were to run the latest Zipline version (installed via GitHub), then it shouldn't be an issue anymore.



On Fri, Oct 5, 2018 at 1:35 PM Mosfiqur Rahman <where.is....@gmail.com> wrote:
Hi,
   I'm trying to ingest 18 symbols in my custom-csvdir-bundle. After ingesting while I'm trying to print out the price. It's showing me the same value for two different symbols. In this case. A  and CDNA. However, if I remove CDNA from the data bundle, then A is picking the values of NTRA and NVTA so on, which means picking the symbols with last character 'A'.

Here are my code and files:


from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))

from zipline.api import order, record, symbol
import pandas as pd
from datetime import datetime
from zipline.api import sid

def initialize(context):
    pass


def handle_data(context, data):
    record(A=data.current(symbol('A'), 'price'))
    record(CDNA=data.current(symbol('CDNA'), 'close'))
    record(BRKR=data.current(symbol('BRKR'), 'close'))
    record(DGX=data.current(symbol('DGX'), 'close'))
    record(DHR=data.current(symbol('DHR'), 'close'))
    record(DXCM=data.current(symbol('DXCM'), 'close'))
    record(EXAS=data.current(symbol('EXAS'), 'close'))
    record(ILMN=data.current(symbol('ILMN'), 'close'))
    record(LH=data.current(symbol('LH'), 'close'))
    record(MYGN=data.current(symbol('MYGN'), 'close'))
    record(NEO=data.current(symbol('NEO'), 'close'))
    record(NTRA=data.current(symbol('NTRA'), 'close'))
    record(NVTA=data.current(symbol('NVTA'), 'close'))
    record(PHG=data.current(symbol('PHG'), 'close'))
    record(PKI=data.current(symbol('PKI'), 'close'))
    record(PRAH=data.current(symbol('PRAH'), 'close'))
    record(QGEN=data.current(symbol('QGEN'), 'close'))
    record(TMO=data.current(symbol('TMO'), 'close'))
    record(TTOO=data.current(symbol('TTOO'), 'close'))

%zipline --bundle=custom-csvdir-bundle --start 2016-8-1 --end 2016-10-3




ABRKRCDNADGXDHRDXCMEXASILMNLHMYGNNEONTRANVTAPHGPKIPRAHQGENTMOTTOOalgo_volatilityalgorithm_period_returnalphabenchmark_period_returnbenchmark_volatilitybetacapital_usedending_cashending_exposureending_valueexcess_returngross_leveragelong_exposurelong_valuelongs_countmax_drawdownmax_leveragenet_leverageordersperiod_closeperiod_labelperiod_openpnlportfolio_valuepositionsreturnssharpeshort_exposureshort_valueshorts_countsortinostarting_cashstarting_exposurestarting_valuetrading_daystransactionstreasury_period_return
2016-08-01 20:00:00+00:004.80024.814.80086.2481.5092.6518.110170.65139.6331.488.52013.048.4026.3956.6947.0826.80159.567.04NaN0.0NaN-0.000829NaNNaN0.010000000.00.00.00.00.00.00.000.00.00.0[]2016-08-01 20:00:00+00:002016-082016-08-01 13:31:00+00:000.010000000.0[]0.0None0.00.00None10000000.00.00.01[]0.0
2016-08-02 20:00:00+00:004.68024.724.68085.2480.9392.7817.750166.92139.3830.828.37013.058.3626.3655.9146.9026.74156.446.110.00.00.0-0.0072350.0626570.00.010000000.00.00.00.00.00.00.000.00.00.0[]2016-08-02 20:00:00+00:002016-082016-08-02 13:31:00+00:000.010000000.0[]0.0None0.00.00None10000000.00.00.02[]0.0
2016-08-03 20:00:00+00:004.85021.794.85085.6580.9890.8718.290165.05140.1331.428.53012.978.5326.2855.7548.2526.59156.006.140.00.00.0-0.0043290.0745850.00.010000000.00.00.00.00.00.00.000.00.00.0[]2016-08-03 20:00:00+00:002016-082016-08-03 13:31:00+00:000.010000000.0[]0.0None0.00.00None10000000.00.00.03[]0.0
2016-08-04 20:00:00+00:004.85021.774.85085.8081.1291.5019.000165.66140.0931.118.32013.108.4426.3655.7249.1326.61156.426.790.00.00.0-0.0032710.0640500.00.010000000.00.00.00.00.00.00.000.00.00.0[]2016-08-04 20:00:00+00:002016-082016-08-04 13:31:00+00:000.010000000.0[]0.0None0.00.00None10000000.00.00.04[]0.0
2016-08-05 20:00:00+00:004.99022.174.99085.6881.5091.2319.250166.53140.7630.468.15012.228.6526.5254.8549.4226.95157.517.480.00.00.00.0048820.0845750.00.010000000.00.00.00.00.00.00.000.00.00.0[]2016-08-05 20:00:00+00:002016-082016-08-05 13:31:00+00:000.010000000.0[]0.0None0.00.00None10000000.00.00.05[]0.0

--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages