Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with Rocket.jl #45

Open
Roh-codeur opened this issue Oct 7, 2023 · 10 comments
Open

Integration with Rocket.jl #45

Roh-codeur opened this issue Oct 7, 2023 · 10 comments

Comments

@Roh-codeur
Copy link

hi,

this looks like an excellent package, thanks for putting this together. for those of us who are new to Julia, from python, could you please illustrate an example of how to integrate this with Rocket.jl?

thanks

@lbilli
Copy link
Owner

lbilli commented Oct 7, 2023

I'm afraid I don't much about Rocket.jl. Could be a nice project to look into it though.

@oliviermilla
Copy link

@Roh-codeur, check out https://github.com/oliviermilla/Lucky.jl. It's exactly what you're looking for a reactive trading framework. It is extendable to sources/providers/else. Integration with Jib isn't started yet though. Looks straightforward if you want to give it a shot.

@oliviermilla
Copy link

@lbilli official releases to Julia's pkg repo would be nice as well. :)

@Roh-codeur
Copy link
Author

@Roh-codeur, check out https://github.com/oliviermilla/Lucky.jl. It's exactly what you're looking for a reactive trading framework. It is extendable to sources/providers/else. Integration with Jib isn't started yet though. Looks straightforward if you want to give it a shot.

Thanks mate, that looks like a great package!

@oliviermilla
Copy link

@lbilli would you be ok to publish your package to Julia's General Package repository?
I can do it with an access to your repo to install the registrator as a Github app: https://github.com/JuliaRegistries/General

or I can do it from a fork on my account.

Up to you :) 🚀

@oliviermilla
Copy link

Hello @lbilli , without any reply from you, I took the liberty to register from my repository. Doing so, I discovered that you recently tried to register the package as well (JuliaRegistries/General#101999).

The registration from my repo is going through (JuliaRegistries/General#102610 ) with a renaming. If that's ok with you, I'll let the registration happen after the three days mandatory waiting period. Let me know if that's something you'd not like, and I'll cancel it in favor of a PR on your repo.

Jib is great. Thank you for it. Interactive Brokers integration is the gateway for many finance enthusiasts in Julia. I hope you'll be pleased to have the package registered, and I'd prefer it to happen from your repo since you are the original author.

Let me know,

Best!

@AUK1939
Copy link

AUK1939 commented Oct 31, 2024

when adding Jib.jl I get the error below. Could InteractiveBrokers.jl use a new UUID rather than reusing the one assigned to Jib.jl?

ERROR: MyPackage=1a1125ae-103a-484f-81ad-3821a6c23649 depends on Jib=f310f2d2-a263-11e8-3998-47bd686f18f7, but entry with UUID f310f2d2-a263-11e8-3998-47bd686f18f7 has name InteractiveBrokers.

As a work around (until this is fixed) I generated a new UUID and added it to the Project.toml of my clone of Jib.jl

import UUIDs
UUIDs.uuid1()
"41201590-9734-11ef-287a-cf349987c9ad"
name = "Jib"
uuid = "41201590-9734-11ef-287a-cf349987c9ad"
authors = ["Luca Billi <[email protected]>"]
version = "0.24.2"

@oliviermilla
Copy link

oliviermilla commented Oct 31, 2024

Hello @AUK1939 , I've referenced your request under a new issue in InteractiveBrokers.jl's repository, as it seems to be the right place for your request.

I'll fix it when I can, though you could push a PR over there to fix the issue.

Seems straightforward: https://www.perplexity.ai/search/julia-generalrepository-uuid-c-vDuRnt0VSrOEG1bCdk0D4g#0 as steps 4+ are not needed.

@AUK1939
Copy link

AUK1939 commented Nov 3, 2024

Hi @oliviermilla

Thanks for the suggestion. I had a quick look at InteractiveBrokers.jl, but not sure I fully understand the motive

From what I gather the main purpose of this package is to extend Jib.jl so that it works with rocket.jl. The way it accomplishes this is to extend Jib.jl so that a user object can be passed to the call backs (a Rocker observable for example). It achieves this through defining a forward method and modifying the functions in Jib::process.jl.

However can't this be accomplished via function closures so that we don't need to modify Jib.jl? Here's some pseudo code of what I mean

function createwrapper(fill_source)
     wrap = Jib.wrapper(
                   execDetails = function(reqId::Int, contract::Jib.Contract, execution::Jib.Execution) 
                                                Rocket.next!(fill_source, execution)
                                          end
                  # other call backs  
                  )
    return wrap
end

I'm sure I'm missing something here, some clarification would be great.

@oliviermilla
Copy link

oliviermilla commented Nov 5, 2024

Hello @AUK1939, thx for your message.

InteractiveBrokers. jl's initial motive was to publish Jib.jl to the Julia General Repository—no more, no less.

On the way, I

  • Removed the hard dependency to DataFrames. (See Cooperation #50)
  • Found a way to simplify the UX significantly, which required Jib's callbacks to dispatch on an object (if provided).

Though my solution is subjective and there may be better approaches, here is an example of the end usage: https://github.com/oliviermilla/Lucky.jl/blob/main/test/ext/test_interactivebrokers_ext_live.jl

The plumbing is here: https://github.com/oliviermilla/Lucky.jl/blob/main/ext/InteractiveBrokersExt.jl. See the wrapper function, which is the equivalent of your approach.

Happy to talk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants