Discussion in 'Programming' started by globalarbtrader, Dec 18, 2015.
^ is that really necessary or even useful ?
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)
I've plugged in optimisation code so that forecast and instrument weights can be estimated, also diversification multipliers:
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
Think you meant to put this on private thread!
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?
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.
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)
2. I then obtain each position by using:
data = csvFuturesData()
for instrument in data.get_instrument_list():
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?
Read the section on the userguide for caching specifically this bit.
- 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
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?
Separate names with a comma.