Giter Site home page Giter Site logo

Comments (4)

tgibson11 avatar tgibson11 commented on August 15, 2024

This was for a passive roll order, if that matters, and it was attempting to add to a short position.

from pysystemtrade.

oldlore avatar oldlore commented on August 15, 2024

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.

tgibson11 avatar tgibson11 commented on August 15, 2024

tgibson11@a144845

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.

frankcodespoorly avatar frankcodespoorly commented on August 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.