Giter Site home page Giter Site logo

Comments (4)

tgibson11 avatar tgibson11 commented on July 16, 2024

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...

  1. My issue was related to Close roll status and I thought it might possibly be related to OP's issue.
  2. Turns out it was not.
  3. My reference to "user error" above refers to my issue, not the OP's.

from pysystemtrade.

oldlore avatar oldlore commented on July 16, 2024

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.

robcarver17 avatar robcarver17 commented on July 16, 2024

So is this now fixed??

from pysystemtrade.

oldlore avatar oldlore commented on July 16, 2024

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)

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.