Comments (11)
Ok, let me have a ponder and I'll make a change.
from nautilus_trader.
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.
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.
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.
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.
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.
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.
Sounds good. Will have a look on it when finished.
from nautilus_trader.
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.
Wow, quite a lot of changes. Great work!
from nautilus_trader.
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)
- Simplify msgspec encoding/decoding for NautilusConfig objects HOT 2
- Refactor the Interactive Brokers Client HOT 1
- ParquetDataCatalog: circular import in `nautilus_trader.config.common` HOT 1
- Feature Request: Automated Generation of Stub Files for Cython Modules in `nautilus_trader` HOT 2
- Portfolio Allocation Tutorial HOT 2
- issue with nautilus-ibapi? fixed by installing most recent IBApi version manually HOT 2
- Enhancement for BacktestEngine in Event-Driven Strategies HOT 2
- pandas: ValueError: The truth value of a Series is ambiguous
- Upgrade hyper dependency to 1.1.0 HOT 1
- Are there any tutorials for stock HOT 1
- KeyError in Binance Spot Instrument Provider HOT 1
- Catalog.query() leaks memory for QuoteTicks and TradeTicks HOT 3
- The example strategy in "Quickstart" document is not working HOT 3
- TWAP Execution broken with Streaming/Persistence HOT 1
- Logging V2 - optimizations and performance profiling
- Nautilus CFD Subscriber
- Binance Order Status EXPIRED_IN_MATCH HOT 3
- Issue serializing IB orders HOT 1
- TWAP Execution fails when number of shares is less than intervals HOT 2
- ParquetDataCatalog write_data takes a very long time HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nautilus_trader.