Comments (4)
This was for a passive roll order, if that matters, and it was attempting to add to a short position.
from pysystemtrade.
I just had the same error occur. I have a short GOLD_micro position with PASSIVE roll status and the system was trying to change the quantity from -2 to -3.
tgibson, how did you deal with it? Change back to NO_ROLL and just allow system to buy current priced contract?
File "/home//pysystemtrade/sysproduction/linux/scripts/run.py", line 67, in <module>
func(*args, **kwargs)
File "/home//pysystemtrade/sysproduction/run_stack_handler.py", line 11, in run_stack_handler
price_process.run_process()
File "/home//pysystemtrade/syscontrol/run_process.py", line 106, in run_process
self._main_loop_over_methods()
File "/home//pysystemtrade/syscontrol/run_process.py", line 132, in _main_loop_over_methods
timer_class.check_and_run(**kwargs)
File "/home//pysystemtrade/syscontrol/timer_functions.py", line 124, in check_and_run
self.run_function(**kwargs)
File "/home//pysystemtrade/syscontrol/timer_functions.py", line 299, in run_function
self._function(**kwargs)
File "/home//pysystemtrade/sysexecution/stack_handler/spawn_children_from_instrument_orders.py", line 45, in spawn_children_from_new_instrum
ent_orders
self.spawn_children_from_instrument_order_id(instrument_order_id)
File "/home//pysystemtrade/sysexecution/stack_handler/spawn_children_from_instrument_orders.py", line 63, in spawn_children_from_instrument_
order_id
list_of_contract_orders = spawn_children_from_instrument_order(
File "/home//pysystemtrade/sysexecution/stack_handler/spawn_children_from_instrument_orders.py", line 118, in spawn_children_from_instrument
_order
list_of_contract_orders = spawn_function(data, instrument_order)
File "/home//pysystemtrade/sysexecution/stack_handler/spawn_children_from_instrument_orders.py", line 165, in single_instrument_child_orders
get_required_contract_trade_for_instrument(data, instrument_order)
File "/home//pysystemtrade/sysexecution/stack_handler/spawn_children_from_instrument_orders.py", line 258, in get_required_contract_trade_fo
r_instrument
return passive_roll_child_order(data=data, instrument_order=instrument_order)
File "/home//pysystemtrade/sysexecution/stack_handler/spawn_children_from_instrument_orders.py", line 339, in passive_roll_child_order
increasing_trade = sign(trade) == sign(position_current_contract)
File "/home//pysystemtrade/syscore/genutils.py", line 155, in sign
return copysign(1, x)
TypeError: must be real number, not tradeQuantity
from pysystemtrade.
This was my workaround. It fixes the problem from the code perspective, but it doesn't seem like logical trading behavior unless you make some assumptions about the conditions that got you to this point...and I have not verified those assumptions.
from pysystemtrade.
I've encountered this issue as well. My understanding is the passive roll status should only create orders that reduce the position of the current contract. Until we have more clarity, I am not using the passive roll status.
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.