Oh no, not another python backtester...

Discussion in 'App Development' started by globalarbtrader, Dec 18, 2015.

  1. Butterfly

    Butterfly

    ^ is that really necessary or even useful ?
     
    #11     Jan 18, 2016
  2. if you have a novel rule you might not know what the scale should be (it's not always possible to work it out without using data)

    GAT
     
    #12     Jan 18, 2016
  3. #13     Jan 29, 2016
  4. apologies for the abrupt time boxing of the chat from my side.
    I found that useful, thanks for the input to portfolio construction, will be looking at the impact of 'smoothed binary' and binary for trade-able lot sizes of 1 over the next 2 weeks. cheers all
     
    #14     Jan 29, 2016
  5. Think you meant to put this on private thread!
     
    #15     Jan 29, 2016
  6. yabz

    yabz

    It is unclear where you get your data from.

    quandl.py contains only:
    get data from quandl
    NOT YET IMPLEMENTED

    Presumably you are using legacy csv data, but where did this come from and how long are the time frames?
     
    #16     Jan 29, 2016
  7. Hi

    Yes this is a work in progress...

    csvdata is using data from my existing database, which is basically daily quandl data, then for the last couple of years I've been sampling intraday mid prices from IB tick stream every hour or so, plus closing prices (which are always timestamped 23:00). All times are local UK system time by the way.

    GAT
     
    #17     Jan 30, 2016
  8. Hi GAT,

    I’ve been using pysystemtrade to backtest several strategies, that I would now like to try to track in real time.

    I am not sure exactly how I should proceed here in terms of pysytemtrade. Please correct me if I’m wrong or if there is a better way to do it, but the steps I am thinking of are as follows:

    1. Run the following code with my config:

    from systems.provided.futures_chapter15.basesystem import *
    from syscore.pdutils import align_to_joint, uniquets, divide_df_single_column
    from syscore.dateutils import generate_fitting_dates
    from syscore.algos import robust_vol_calc
    from systems.portfolio import Portfolios
    config = Config("private.my_system.futuresestimateconfig.yaml")
    system = System([Account(), Portfolios(), PositionSizing(), FuturesRawData(), ForecastCombine(), ForecastScaleCap(), Rules()], csvFuturesData(), config)
    system.set_logging_level("on")
    system.accounts.portfolio()


    2. I then obtain each position by using:

    data = csvFuturesData()
    for instrument in data.get_instrument_list():
    system.accounts.get_buffered_position(instrument, roundpositions=True).tail()



    3. Assume then nothing changes except that I get new price data coming in for each instrument. How should I proceed in order to obtain new updated positions based on new data without having to run the whole system again?
     
    #18     Jun 3, 2016
  9. Read the section on the userguide for caching specifically this bit.

    Basically you'd:

    - run the entire system
    - when you get a new price for a particular instrument, remove the relevant contents of the cache
    - get the buffered position

    GAT
     
    #19     Jun 6, 2016
  10. I see, thanks GAT. With respect to the 'delayfill=True' function, does this only apply to accounting (e.g., 'system.accounts.portfolio(delayfill=False)' ) and not position generation with the 'system.accounts.get_buffered_position(instrument, roundpositions=True)' method, or does the 'delayfill' feature not affect the get_buffered_position feature?
     
    #20     Aug 6, 2016