Giter Club home page Giter Club logo

Comments (3)

polakowo avatar polakowo commented on May 12, 2024 3

This is the same as passing call_seq=‘auto’ to any of Portfolio.from_orders and Portfolio.from_signals, which reorders your orders by their value, so you can first execute the sell orders to release funds required by the buy orders. This is common for rebalancing. The reason why call_seq=‘auto’ can’t passed to Portfolio.from_order_func is because you generate orders dynamically and so the function doesn’t know how to sort your orders until it calls each order in the group, and so you must call it manually in the segment preparation function. Under the hood, auto_call_seq_ctx_nb takes information on each order in the current group and at current timestamp (that is, segment) and sorts call_seq in a way that sell orders are executed first. It doesn’t return anything because it simply changes call_seq in-place, which is an attribute of the simulation. For example, call_seq by default is [0, 1, 2] and after sorting it can be [1, 2, 0], which means that second column in the group is executed first, while first column is executed last. After you have done it, use oc.call_seq_now[oc.call_idx] to get index of the element this call corresponds to.

from vectorbt.

wukan1986 avatar wukan1986 commented on May 12, 2024 2

You can debug code in pycharm

import os
os.environ['NUMBA_DISABLE_JIT'] = '1'

# numba code

from vectorbt.

theomart avatar theomart commented on May 12, 2024 2

Thanks to both of you! Super clear explanation and I was actually pretty sad to not be able to debug the numba code, now I can, thank you :)

from vectorbt.

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.