GithubHelp home page GithubHelp logo

Comments (11)

cjdsellers avatar cjdsellers commented on May 20, 2024 1

Ok, let me have a ponder and I'll make a change.

from nautilus_trader.

cjdsellers avatar cjdsellers commented on May 20, 2024

This is similar logic to what already occurs. Currently there is .id which is the identifier set by the user/client, and there is id_broker which is determined once accepted by the broker. On reflection this may be slightly confusing as it looks like its the identifier FOR the broker.

I accept the naming here could be better, clOrderID is already established in FIX protocols and I believe BitMEX for example use client_id and their own order_id?

I like the idea of two separate classes though so there is no chance of mixing up a ClientOrderId with the brokers OrderId... not certain of the best naming convention though.

from nautilus_trader.

cjdsellers avatar cjdsellers commented on May 20, 2024

Also bear in mind I would like to continue having the platform general for as many trading domains as possible including more traditional brokers such as IB, FXCM etc. So it's not always an exchange we're dealing with directly.

from nautilus_trader.

scoriiu avatar scoriiu commented on May 20, 2024

Yes, Bitmex and many more use this notation Order.id and Order.client_id. So I think having client_id or id_client instead of id_broker is more clear and generic as well.

from nautilus_trader.

cjdsellers avatar cjdsellers commented on May 20, 2024

I've had a read of a couple of the other APIs plus FIX. client_id it is. I'll change the class name to ClientOrderId and OrderId will now be that which is assigned by the broker/exchange.

What are your thoughts on the position ids now? There's a similar issue.

from nautilus_trader.

scoriiu avatar scoriiu commented on May 20, 2024

I'm not sure I follow regarding id-ing the position. As far as I know the position is identified by the account_id and the instrument. Some exchanges doesn't even return the account_id for the position, some of them return a unique id. There certainly is not a uniform interface for it.

I didn't yet see the case where the user is given the option to provide the id when opening a position.

from nautilus_trader.

cjdsellers avatar cjdsellers commented on May 20, 2024

Sure. Well the platform currently allows the user to specify a client_id for positions ahead of time (to associate with an order), this may be redundant though. It should only be necessary to wait for the broker/exchange assigned ticket/position_id or whatever they may call it.

The refactoring for the client order ids should be complete shortly. On Order the property is client_id on the events its cl_ord_id just following the conventions I'm seeing in API docs.

Those broker_ids just become id on the Order, and order_id on the events.

from nautilus_trader.

scoriiu avatar scoriiu commented on May 20, 2024

Sounds good. Will have a look on it when finished.

from nautilus_trader.

cjdsellers avatar cjdsellers commented on May 20, 2024

Ok I managed to get that one through. Quite a large commit.

I may need to tidy up some documentation in due course.

I'll keep investigating the usage of the position ids too.

from nautilus_trader.

scoriiu avatar scoriiu commented on May 20, 2024

Wow, quite a lot of changes. Great work!

from nautilus_trader.

cjdsellers avatar cjdsellers commented on May 20, 2024

I decided for clarity to standardize on cl_ord_id for the order property as well.

I did another refactoring sweep and picked up a lot of documentation too.

I'm investigating whether this cl_pos_id client position identifiers are event necessary. For simplicity it would be better just to use whatever the broker/exchange assigns (if anything).

from nautilus_trader.

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.