Trading on NinjaTrader8 from Bookmap via Java

Custom indicators, trading strategies, data export and recording and more...
izzowitz
Posts: 5
Joined: Wed May 12, 2021 2:23 pm

Trading on NinjaTrader8 from Bookmap via Java

Post by izzowitz » Wed May 12, 2021 2:37 pm

Hi,

Trying to find forum threads on trading into NinjaTrader8 from Bookmap. I already know how to set up the connection for manual chart trade submission: submit order on Bookmap and the resting order gets pushed to my NinjaTrader8 environment. I now want to find content on doing this via a Java file for automating order submissions when conditions are met in some of these awesome Bookmap metrics.

Any direction to other threads or online content would be great. 

Thank you much,
Tim

Svyatoslav
Site Admin
Posts: 183
Joined: Mon Jun 11, 2018 11:44 am
Has thanked: 2 times
Been thanked: 25 times

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by Svyatoslav » Thu May 13, 2021 7:28 am

Andrey might provide more details later, but in two words - there should be no major difference between platforms, so you'd trade through Ninja in a way very similar to how you'd trade through most other providers. So you would just send and update orders using classes implementing OrderSendParameters and OrderUpdateParameters/OrderCancelParameters, then watch for data and trades via all the standard callbacks (which differ depending on if you want simplified or core API).

AndreyR
Posts: 409
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 17 times
Been thanked: 70 times

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by AndreyR » Thu May 13, 2021 8:06 am

Hi Tim,
I do not know a lot about your background so here is some general info. You need to use Bookmap API to write code for Bookmap. There are Core API (more functional and more complicated) and Simplified API (easier to understand, less functional, based on Core API). Both allow trading strategies. We would recommend to start with Simplified API and switch to Core API if you need more features.
Here is a tutorial for Simplified API
https://bookmap.com/knowledgebase/docs/API-Tutorial
and some examples https://github.com/BookmapAPI/DemoStrategies/tree/7.2
(Simplified API modules are in the package https://github.com/BookmapAPI/DemoStrat ... ified/demo)
First make sure you are OK with indicators (drawing lines on the chart). For trading you need your module to be annotated with @Layer1TradingStrategy (see the CancelOrdersCloseToMarket.java in the package). Before real trading you need to thoroughly test your strategy at an exchange that has a sandbox (a testing server which allows to perform mock trading).

izzowitz
Posts: 5
Joined: Wed May 12, 2021 2:23 pm

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by izzowitz » Thu May 13, 2021 3:35 pm

Thank you both!

I am a veteran trader and quant researcher (all Python and C#) new to java and new to your platform. I am basically trying to automate out some fairly simple decision making I use your platform for. For instance, let's say I have a long only bias for a single day. If the market gets to a red heat map area from above it, and all of a sudden cvd_buyers hits a certain level, I want a market buy order sent to NT8. This seems doable right? Pretty simple stuff to start.

I will review the links and then reply with questions here.

Thanks again

blk
Posts: 44
Joined: Fri Nov 01, 2019 8:59 pm
Has thanked: 7 times

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by blk » Thu May 13, 2021 3:40 pm

Here is an example of how to send an order via Simplified API:
 

Code: Select all

SimpleOrderSendParametersBuilder simpleOrder = new SimpleOrderSendParametersBuilder(alias, isBuy,                 size);
simpleOrder.setLimitPrice(limitPrice);
OrderSendParameters testOrder = simpleOrder.build();
api.sendOrder(testOrder);
You can check the java doc inside the Bookmap lib dir: bm-simplified-api-wrapper-javadoc and bm-l1api-javadoc

izzowitz
Posts: 5
Joined: Wed May 12, 2021 2:23 pm

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by izzowitz » Thu May 13, 2021 4:32 pm

Thanks blk

So you recommend simple API for the kind of trade I am talking about: basically monitoring some of the Bookmap internal indicators like CVD_b and CVD_s and creating simple logic for sending orders? I'm digging in now to the links above. 

Thanks

Svyatoslav
Site Admin
Posts: 183
Joined: Mon Jun 11, 2018 11:44 am
Has thanked: 2 times
Been thanked: 25 times

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by Svyatoslav » Thu May 13, 2021 4:34 pm

Note that where there will be a problem is monitoring built-in indicators. That's not currently supported. However CVD is really simple (just add up trade sizes that pass your filter), so you probably will be able to easily implement it yourself.

izzowitz
Posts: 5
Joined: Wed May 12, 2021 2:23 pm

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by izzowitz » Thu May 13, 2021 6:11 pm

Thank you all! Really appreciate it.

-T

izzowitz
Posts: 5
Joined: Wed May 12, 2021 2:23 pm

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by izzowitz » Mon May 24, 2021 6:22 pm

Svyatoslav wrote:
Thu May 13, 2021 4:34 pm
Note that where there will be a problem is monitoring built-in indicators. That's not currently supported. However CVD is really simple (just add up trade sizes that pass your filter), so you probably will be able to easily implement it yourself.

Is there a locale online that shows all the methods and built in library components for the API? Simple items like quantity of last traded price and similar? If so, could you point me?

Thank you,
Tim

AndreyR
Posts: 409
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 17 times
Been thanked: 70 times

Re: Trading on NinjaTrader8 from Bookmap via Java

Post by AndreyR » Tue May 25, 2021 8:51 am

Hi Tim, these are urls to generated javadocs for 7.2.0 Core and Simplified API libs respectively.
http://javadoc.bookmap.com/maven2/releases/com/bookmap/api/api-core/7.2.0/index.html
http://javadoc.bookmap.com/maven2/releases/com/bookmap/api/api-simplified/7.2.0/index.html
Please change the lib version accordingly to your Bookmap version (e.g. if you're running 7.2.0 build 10 your url for the Simplified API will be
http://javadoc.bookmap.com/maven2/releases/com/bookmap/api/api-simplified/7.2.0.10/index.html
)
Please also see usage examples
https://github.com/BookmapAPI/simple-demo
https://github.com/BookmapAPI/DemoStrategies

Post Reply