Oh no, not another python backtester...

Hi GAT, Is there a way to dig out the information on trades in pysystemtrade i.e. to evaluate the distribution of trades (not the daily distribution of returns)?
 
Not in an easy way right now

GAT


Hi GAT,

you wrote a blog post about using Native IB API. However I don't see the code in your github, what's available is some code that works with IBSwig framework. Do you plan to release this part on github? If you are, will it be a live trading framework or some tests and examples similar to the IBSwig?
 
Hi GAT,

you wrote a blog post about using Native IB API. However I don't see the code in your github, what's available is some code that works with IBSwig framework. Do you plan to release this part on github? If you are, will it be a live trading framework or some tests and examples similar to the IBSwig?

If you actually read the series of blog posts they each reference several gists on git hub. A summary is here:

https://qoppac.blogspot.co.uk/p/code.html

This section: gists: python-IB-API

GAT
 
from systems.provided.futures_chapter15.estimatedsystem import futures_system

system = futures_system(log_level="on")

print(system.accounts.portfolio().sharpe())

acc_curve=system.accounts.pandl_for_subsystem("AUD")


The above code fails at

W:\GDrive\19\Code\Python\pysystemtrade\syscore\optimisation.py in decompose_group_pandl(data, identifier, pool_costs, pool_gross, backfillavgcosts)
370
371 """
--> 372 assert identifier in data.keys()

It seems that initially, the system has 38 instruments but when I try to focus on a single instrument, data.keys() contains only "CORN", "EDOLLAR", "EUROSTX", "MXP", "US10", "V2X"

Is there any reason why this is happening?
 
from systems.provided.futures_chapter15.estimatedsystem import futures_system

system = futures_system(log_level="on")

print(system.accounts.portfolio().sharpe())

acc_curve=system.accounts.pandl_for_subsystem("AUD")


The above code fails at

W:\GDrive\19\Code\Python\pysystemtrade\syscore\optimisation.py in decompose_group_pandl(data, identifier, pool_costs, pool_gross, backfillavgcosts)
370
371 """
--> 372 assert identifier in data.keys()

It seems that initially, the system has 38 instruments but when I try to focus on a single instrument, data.keys() contains only "CORN", "EDOLLAR", "EUROSTX", "MXP", "US10", "V2X"

Is there any reason why this is happening?

Basically there is data for 38 instruments, but the default example only has the subset of instruments covered in my book.

https://github.com/robcarver17/pysy...-a-backtest-on-a-different-set-of-instruments

GAT
 
Hi GAT,

I notice a bug(?) in pysystemtrade.

Code:
system.accounts.portfolio(roundpositions=False,delayfill=False)

>>> system.data.daily_prices("GBP").tail(10)
Loading csv data for GBP
2017-01-05    1.2427
2017-01-06    1.2293
2017-01-09    1.2178
2017-01-10    1.2179
2017-01-11    1.2223
2017-01-12    1.2178
2017-01-13    1.2200
2017-01-16       NaN <-------- Holiday
2017-01-17    1.2411
2017-01-18    1.2352

>>> system.accounts.get_notional_position("GBP").tail(10)
2017-01-05   -84.629566
2017-01-06   -77.148345
2017-01-09   -75.307283
2017-01-10   -78.993038
2017-01-11   -81.460877
2017-01-12   -85.617533
2017-01-13   -88.694337
2017-01-16   -88.694339
2017-01-17   -86.485507
2017-01-18   -88.339476

>>> system.accounts.pandl_for_instrument("GBP").tail(10)
2017-01-05    -7555.350031
2017-01-06    10596.153621
2017-01-09     8760.748599
2017-01-10      -72.328423
2017-01-11    -2942.568750
2017-01-12     3170.171272
2017-01-13    -1588.764330
2017-01-16        0.000000
2017-01-17        0.000000 <-------- not supposed to be zero
2017-01-18     4656.453583

Very late in the day but this seems to be fixed.

GAT
 
Back
Top