Ninja Trader Custom Order Book - 1LDom - Source Code - NinjaTrader Programming | futures io social day trading
futures io futures trading


Ninja Trader Custom Order Book - 1LDom - Source Code
Updated: Views / Replies:72,079 / 356
Created: by 1LotTrader Attachments:83

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 83  
 
Thread Tools Search this Thread
 

Ninja Trader Custom Order Book - 1LDom - Source Code

  #21 (permalink)
Elite Member
Cucamonga, CA
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Optimus & Rithmic
Favorite Futures: TF
 
kalalex's Avatar
 
Posts: 197 since Mar 2011
Thanks: 223 given, 126 received


pbylina View Post
Theres more then 10. I can see atleast 18 levels of depth on ASK in 1Lot's video.:-)

I could be wrong but I think that's another fix to be done.
I used it for awhile and found that more depth than 10 (at least for ES) is some kind of residue.

For TF and CL you can see more than 10..

Reply With Quote
The following user says Thank You to kalalex for this post:
 
  #22 (permalink)
Elite Member
Georgia, US
 
Futures Experience: None
Platform: Various
Favorite Futures: Various
 
josh's Avatar
 
Posts: 4,897 since Jan 2011
Thanks: 5,143 given, 11,242 received


pbylina View Post
Theres more then 10. I can see atleast 18 levels of depth on ASK in 1Lot's video.:-)

CME provides 10 levels of depth for most products including ES, and no more than that for any that I am aware of. Note that the higher ones in the video do not change; this should be a clue that the numbers simply have not refreshed.

Reply With Quote
The following 2 users say Thank You to josh for this post:
 
  #23 (permalink)
 Vendor: the1lottrader.com 
Douglas, United Kingdom
 
Futures Experience: Advanced
Platform: Custom
Favorite Futures: Bund
 
1LotTrader's Avatar
 
Posts: 181 since Jun 2009
Thanks: 206 given, 445 received



pbylina View Post
All levels of the book? I assumed the futures exchanges only allowed for 5 levels of depth...So Ninja is to blame.


Did I understand you right. So you can build a Dom in its own separate window for Ninja? Can you show us a picture please?:-)

Yes there are more than 5 levels, I will look to see about those residual numbers.

Ninja uses C# and has the ability to integrate a DLL so you can do absolutely anything you want with it. You basically create yourself a function call in c# externally like a small API and then you attach that DLL to a ninja indicator and that gives you access to your own custom C# programs from within Ninja. From there you can call absolutely whatever you want, be it a form or external charts or writing to databases or whatever. Essentially all you are doing is creating an API bridge to your external C# stuff, it is not difficult but the possibilities are endless.

If you want to see an example go and look for a guy called DionysusToast, he is a commercial member but he has done that.

I did not write my new book from Ninja, I wrote it from scratch and hooked it directly into CQG's API, not AMP, it is in fact the same API that AMP uses. I did so for speed reasons and also some other reasons. I am registered as a professional on Eurex and trade directly through a clearing member, those guys don't offer things like Ninja feeds etc., only CQG and some other systems that are catered more towards professionals and prop shops etc., so one primary reason was that I couldn't get an account with those guys without having some form of software that allowed me to trade through them. So that was a large motivator to undertake the work. I am primarily a trader these days and I always tell people I am not bothered in writing tech for the sake of writing tech unless it serves some sort of purpose and there is nothing else available that fits the bill. As you see I knocked up this Ninja book very quickly and used it for months. My aim was to learn the order book and I needed a tool that allowed me to do that cheaply so this is what I created. Sure it could be much better, much more optimal, faster, less bugs and better user tested but for me it fulfilled the primary purpose which was to learn an order book. Not fiddle around with shiny software for a year.

As it happened, once I got used to it I was forced anyway to make an upgrade but given the choice I would rather not focus my time on such things. Trading requires 24hours a day as it is.

1Lot

Reply With Quote
The following 2 users say Thank You to 1LotTrader for this post:
 
  #24 (permalink)
 Vendor: the1lottrader.com 
Douglas, United Kingdom
 
Futures Experience: Advanced
Platform: Custom
Favorite Futures: Bund
 
1LotTrader's Avatar
 
Posts: 181 since Jun 2009
Thanks: 206 given, 445 received

Ok guys, so i've made some changes this morning. I have attached the latest source. Just copy over the last one and recompile. This is not an official new version, I would like to ascertain the issues are ironed out.

Some changes I have made:

1. The blue screen issue that we previously talked about should be gone.
2. In the indicator parameters I have created a new tab with Performance labelled on it that contain these options:

a) refresh: basically if you redraw the screen on every single change that comes through the pipe on all levels it will choke your machine off, that threshold varies for different people. If you set this to zero, it will redraw on every single refresh. This may be ok for some folk. It is for me. If it is choking then you can set this up with a delay. The number you punch in is a millisecond delay. So the way this works is this. The DOM will always refresh on a trade or volume update, regardless of time. This delay will function if there is no volume update. In that case it will snapshot the bid/ask changes every so many milliseconds as opposed to showing every single change. Tinker with this to find the right mix for you.
b) If you are using IB then set the IB parameter to true; if not set it to false. IB has crap BID/ASK and I had to write some code in there to deal with it. I found this code was still functioning on other feeds and hindering performance, so i have set it up as an IB option to only be switched on with IB feeds. If you have IB and you don't switch it on, you will see some funny bid asks that don't clear. Also beware that if you read an IB book you are in fact not looking at a real book but a synthetic book as your feed will consists of IB snapshots as opposed to the tick level streams from places like IQFeed/AMP/Mirus etc. etc.
c) FastLevels: This is the number of levels from the inside bid/ask that will be updated on MarketDepth events. Default is 5. What this means is that below 5, these levels will update only on a trade (volume), if you set the level to 10 on ES then all levels will be changed by the bid/ask event. It is not necessary though to have outside levels refreshing at super fast rates but each to his own. I would recommend the inside 5. Bare in mind the Fast Levels are subject to the refresh in A. If A is set to zero this means all fastlevels will be refreshed on every single depth change for that level. If there is a delay then a snapshot every x milliseconds for a change in that level. Non-fast levels will update only on a trade (volume update). If you want them all fast levels, then set it to encompass all the bids. As I said it is dependant on each persons machine. If you are running 5 doms in different markets then you will need to tune it down. If you run a monster set up with one DOM then perhaps you can put it on full tuning and not even a fast market will have an impact on your CPU. You need to find the balance for your setup. I think these options that I have exposed will allow you to do that.

Hope that all makes sense for the tuning.

3. I have sorted out the issue whereby there was some trailing bid/asks not clearing. This was to do with a feed issue whereby the filtered and unfiltered feeds work differently. Hopefully it is sorted. I have tested this on AMP/CQG. Hopefully it is ok on other feeds also now.

If you guys want to download and run it and see if these options are all working ok (specifically that the blue screen is gone). That would be helpful.

I am going to run it all day today and tomorrow and see that it is stable. I thought I would release it early as many hands are better than one.

1Lot

Attached Files
Register to download File Type: cs OneLDOM.cs (89.0 KB, 127 views)

Last edited by 1LotTrader; September 20th, 2012 at 08:22 AM.
Reply With Quote
The following 5 users say Thank You to 1LotTrader for this post:
 
  #25 (permalink)
 Vendor: the1lottrader.com 
Douglas, United Kingdom
 
Futures Experience: Advanced
Platform: Custom
Favorite Futures: Bund
 
1LotTrader's Avatar
 
Posts: 181 since Jun 2009
Thanks: 206 given, 445 received

Two more small updates. Attached is latest source.

1. Found an issue with YM price constant ladder, ticksize of 1 was causing Zero price.
2. Updated IB price feed to correctly account for depth of book levels instead of using constants.

Two Tips:

a) When you first load a chart right click and choose the reload historical data option. This will ensure the chart is fully loaded with all data for the day in the profile etc.
b) When setting the DOM for a particular market be sure in the indicator options area to go down to Price Constant and set the Decimal to the Decimal setting of that market example: ES is 2 decimals so set Decimal2, FDAX is 1 decimal so set Decimal1, YM is no Decimal so set to Normal.

See below these images, these are the common markets I have been testing today and the feed is AMP with IB option set to false. So far I think they are all looking good on latest version.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


That's me for the day. I will wait for further feedback.

1Lot

Attached Files
Register to download File Type: cs OneLDOM.cs (86.5 KB, 128 views)

Last edited by 1LotTrader; September 20th, 2012 at 10:26 AM.
Reply With Quote
The following 5 users say Thank You to 1LotTrader for this post:
 
  #26 (permalink)
Elite Member
Georgia, US
 
Futures Experience: None
Platform: Various
Favorite Futures: Various
 
josh's Avatar
 
Posts: 4,897 since Jan 2011
Thanks: 5,143 given, 11,242 received

I like it a lot.

As the screen shot shows, there is a refresh error at the current inside bid/ask. One stays, and then when the market moves it refreshes.

Also, I do not see an option to highlight the last price traded (Xtrader provides this) in the price ladder itself, much like NT's DOM does by default.

Finally, for real DOM functionality it will be desirable to actually be able to place order without using NT's chart trader, as right-clicking, moving the mouse, and clicking again just doesn't work so well in a DOM

Nice work!!

Attached Thumbnails
Ninja Trader Custom Order Book - 1LDom - Source Code-dom.png  
Reply With Quote
The following 2 users say Thank You to josh for this post:
 
  #27 (permalink)
 Vendor: the1lottrader.com 
Douglas, United Kingdom
 
Futures Experience: Advanced
Platform: Custom
Favorite Futures: Bund
 
1LotTrader's Avatar
 
Posts: 181 since Jun 2009
Thanks: 206 given, 445 received

Josh are you using Interactive Brokers? That problem is reminiscent of using IB without the IB option set to true.

If you load it with the template I gave out then you should be able to see how it's trading fairly easily. It in fact shows what last traded as well as how it traded, i.e. up (green) or down (red) or cumulative at the same level (white). Same as X-Trader. See my blog here for the full instructions:
https://futures.io/ninjatrader-programming/23233-ninjatrader-trader-custom-order-book-1ldom-source-code-3.html and description of it. This is the reason I released it: Learning to Trade the Order Book (Software) ~ The 1Lot Trader

I agree regards placing the trades. This DOM is for most a stepping stone to a fully functional DOM, when I first moved I was very used to chart trading. I found it easy to use without having to change my process to much in terms of the intricacies of DOM order placing and management. It is mostly a tool focused on learning to read the DOM in a format that is usable while not costing an arm and a leg to do so. I do not believe Ninja standard DOM is good enough in this regard without a profile. Really the chart trader and the ability to place both Sim and live orders is an added bonus on this but if you wanted to create a fully fledged DOM that is the best of the best then a good starting point is bypassing Ninja completely. That is not the intended purpose though. This is just a free tool that i hoped some would find useful in there own journey of learning a DOM, i know when I started with it there wasn't anything really suitable around for doing that. You can go to the cheap version of X-Trader but then the headaches arise with integration of the feed with the charts and on and on. I went through it back then. This tool fills a small gap for Ninja users, nothing more nothing less.

1Lot

*EDIT* 15:40 I just did a double check and that error definitely does not exist on the AMP feed, I notice your numbers are a bit jumbled though which would imply the screen redraw is not happening correctly. As you seem to be missing the volume ladder in your picture it may be the case that the Bid/Ask columns have moved out of the redraw fields that I set the code to monitor. I refresh only the bid/ask draw areas instead of the whole chart for performance reasons. So it may be this. we need to see if it exists with the standard template.


Last edited by 1LotTrader; September 20th, 2012 at 11:44 AM.
Reply With Quote
The following user says Thank You to 1LotTrader for this post:
 
  #28 (permalink)
Elite Member
zürich/ switzerland
 
Futures Experience: None
Platform: NT7, Sierra
Favorite Futures: CL
 
philipp's Avatar
 
Posts: 128 since Nov 2010
Thanks: 48 given, 108 received

sorry for the question, but how do i import the cs file?
thx

Reply With Quote
 
  #29 (permalink)
Elite Member
Northern Germany
 
Futures Experience: Intermediate
Platform: NT
Favorite Futures: FDAX, CL
 
vvhg's Avatar
 
Posts: 1,583 since Mar 2011
Thanks: 1,016 given, 2,807 received


philipp View Post
sorry for the question, but how do i import the cs file?
thx

Simple search returns this thread: Importing a .cs - file indicator / strategy

vvhg

Hic Rhodos, hic salta.
Reply With Quote
The following user says Thank You to vvhg for this post:
 
  #30 (permalink)
Elite Member
zürich/ switzerland
 
Futures Experience: None
Platform: NT7, Sierra
Favorite Futures: CL
 
philipp's Avatar
 
Posts: 128 since Nov 2010
Thanks: 48 given, 108 received


thanks vvhg,

but i cannot edit the ninja script via the control center (this i know how to do), because its simply not there.

Reply With Quote

Reply



futures io > > > > > Ninja Trader Custom Order Book - 1LDom - Source Code

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
The order book - why bother? DionysusToast Traders Hideout 9 September 3rd, 2013 08:27 AM
Looking for Ninja Trader order book indicator. jerdog NinjaTrader 2 November 29th, 2011 05:43 AM
Zenfire C# API with source code tinkerz Reviews of Brokers and Data Feeds 3 July 24th, 2011 02:35 AM
How to set up a Stop (Limit) Loss order - Ninja Trader jdumanic NinjaTrader 2 June 7th, 2011 06:40 PM
New Version Ninja Trader 7 / code breaking change Mauro_60 The Elite Circle 6 September 15th, 2010 09:13 AM


All times are GMT -4. The time now is 01:15 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-13 in 0.16 seconds with 20 queries on phoenix via your IP 54.82.79.109