Comments (4)
Disregard my previous comment (I'm going to delete it, but wanted to explain)...closer inspection of the logs shows that 2 contract orders were created because I ran the method for creating roll orders manually, then stack handler ran it a second time.
It would be nice if this situation was recognized and handled better (by not creating duplicate contract orders)...but ultimately it could be considered user error, since that method seems to be intended to run only once per day.
Edit:
So...deleting my previous comment was probably a mistake because now there's no context for this one. So...
- My issue was related to Close roll status and I thought it might possibly be related to OP's issue.
- Turns out it was not.
- My reference to "user error" above refers to my issue, not the OP's.
from pysystemtrade.
So I tried generating a force roll order using interactive order stack and it also failed. Did some digging with elementary python skills and I think I localized the bug to roll_orders.py function in line 98:
def check_if_positions_require_order_generation(self, instrument_code: str) -> bool:
position_in_priced = get_position_in_priced(
data=self.data, instrument_code=instrument_code
)
if position_in_priced == 0:
## no need to roll
return False
If you have a position in the instrument this function always returns None, which causes line 79 to return True and the process to create and add orders to the stack fails.
roll_orders_required_from_positions = self.check_if_positions_require_order_generation(instrument_code)
if not roll_orders_required_from_positions:
## if we don't exit here will get errors even it we're not rolling
return False
LOL which is exactly what tgibson fixed in #1245
Oops!
from pysystemtrade.
So is this now fixed??
from pysystemtrade.
I have a close order today for GAS_US_mini. Stack handler did create a contract order but trade isn't due to happen for a couple hours, so I will update if it goes through. On the other hand, I had 2 force rolls as well. Stack handler created instrument/contract orders as expected but nothing further is happening. See #1249
EDIT: The close order went through okay. So I think this issue is fixed.
from pysystemtrade.
Related Issues (20)
- using current python (3.11) and current everything else is possible HOT 2
- span or com? HOT 1
- Manually setting capital for has errors with parquet HOT 7
- Make it easier to run as a system seperatef from IB
- contract data not pulling from mongodb, but now appears to reside in parquet HOT 1
- Start collecting open interest data? HOT 1
- Production Docs: FX data: Initialise the spot FX data in MongoDB from .csv files; error in repocsv_spotfx_prices.py HOT 1
- Euribor Data triggering weird results HOT 4
- Clean install, PyYAML 5.4 error HOT 2
- Add commissions from IB to spread check report and update script HOT 1
- Bunch of new markets added create error on whatif orders HOT 1
- robust_vol_calc(price.diff()) but robust_vol_calc expect daily_returns
- Rollconfig of NASDAQ_mini
- Migrating capital data from arctic to parquet does not work HOT 4
- Intraday futures strategies
- Installation problems HOT 1
- plan succession of ib_insync
- Non-monotonically increasing timestamp in spread data
- Initialize Capital Fails if __global_capital.parquet Doesn't Exist
- /reconcile Endpoint Fails on Second and Subsequent Requests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysystemtrade.