Hi there
I've been looking through the example code from the Bookmap GitHub account, as well as through all of the topics on the forum, and the JavaDoc for the Layer 1 API.
I can't find any info on fetching order details for the logged-in Bookmap user. What I would like to be able to read is the following:
- Current limit orders the user has on the order book.
- Current open positions the user has (i.e. market orders they placed, and limit orders they had in the book which were subsequently filled and became market orders)
- Current market-stops for the user's open position(s)
- Current limit-stops for the user's open position(s)
I'd like to be able to use this information to write some automation on my own strategies.
From what I've seen in the example code, it looks like I would have to write something to track current orders myself by overriding the methods in the OrdersListener interface, as shown in the CancelOrdersCloseToMarket example. Is this correct?
Thanks,
Scott Edwards
Reading all current user orders (market, limit, stop limit, and market stop)
-
- Posts: 548
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: Reading all current user orders (market, limit, stop limit, and market stop)
Hi Scott,
1, 3, 4) when your module gets loaded all your (market/limit/...) current (and sometimes recently filled/canceled) orders are passed to your onOrderUpdated method. Filter out whatever order type you need.
2) your position is passed to the onPositionUpdate method if your module implements the PositionListener interface.
These methods belong to listeners of the Simplified API which is very easy to use.
SImplified API examples:
https://github.com/BookmapAPI/DemoStrat ... ified/demo
You can get the javadoc from:
This location is for Windows. Use a similar location for any other OS. Rename from .jar to .zip and open the index.html.
1, 3, 4) when your module gets loaded all your (market/limit/...) current (and sometimes recently filled/canceled) orders are passed to your onOrderUpdated method. Filter out whatever order type you need.
2) your position is passed to the onPositionUpdate method if your module implements the PositionListener interface.
These methods belong to listeners of the Simplified API which is very easy to use.
SImplified API examples:
https://github.com/BookmapAPI/DemoStrat ... ified/demo
You can get the javadoc from:
Code: Select all
C:\Program Files\Bookmap\lib\bm-simplified-api-wrapper-javadoc.jar
Re: Reading all current user orders (market, limit, stop limit, and market stop)
Great, thank you very much!
Re: Reading all current user orders (market, limit, stop limit, and market stop)
In Replay mode the onPositionUpdate and onBalance seems not to be called even if there is no historical listener. I have :
implements CustomModule, TradeDataListener, CustomSettingsPanelProvider, IntervalListener, OrdersListener, PositionListener, BalanceListener
Is it normal? Is there a trick to call them? Right now I manage my current positions updating a variable, but a regular consolidation between calculated and actual positions would be beneficial.
implements CustomModule, TradeDataListener, CustomSettingsPanelProvider, IntervalListener, OrdersListener, PositionListener, BalanceListener
Is it normal? Is there a trick to call them? Right now I manage my current positions updating a variable, but a regular consolidation between calculated and actual positions would be beneficial.
-
- Site Admin
- Posts: 278
- Joined: Mon Jun 11, 2018 11:44 am
- Has thanked: 2 times
- Been thanked: 31 times
Re: Reading all current user orders (market, limit, stop limit, and market stop)
Unfortunately bookmap simulated trading (which is what you have in replay) does not currently implement balance and position updates. That's something we need to eventually implement.