Page 1 of 1

Trading on NinjaTrader8 from Bookmap via Java

Posted: Wed May 12, 2021 2:37 pm
by izzowitz
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

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Thu May 13, 2021 7:28 am
by Svyatoslav
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).

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Thu May 13, 2021 8:06 am
by Andry API support
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).

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Thu May 13, 2021 3:35 pm
by izzowitz
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

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Thu May 13, 2021 3:40 pm
by blk
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

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Thu May 13, 2021 4:32 pm
by izzowitz
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

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Thu May 13, 2021 4:34 pm
by Svyatoslav
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.

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Thu May 13, 2021 6:11 pm
by izzowitz
Thank you all! Really appreciate it.

-T

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Mon May 24, 2021 6:22 pm
by izzowitz
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

Re: Trading on NinjaTrader8 from Bookmap via Java

Posted: Tue May 25, 2021 8:51 am
by Andry API support
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