NexusFi: Find Your Edge


Home Menu

 





Ninja Trader Custom Order Book - 1LDom - Source Code


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one 1LotTrader with 120 posts (318 thanks)
    2. looks_two Silvester17 with 27 posts (74 thanks)
    3. looks_3 Zondor with 17 posts (28 thanks)
    4. looks_4 philipp with 14 posts (7 thanks)
      Best Posters
    1. looks_one aligator with 3 thanks per post
    2. looks_two 1LotTrader with 2.7 thanks per post
    3. looks_3 Silvester17 with 2.7 thanks per post
    4. looks_4 Zondor with 1.6 thanks per post
    1. trending_up 170,561 views
    2. thumb_up 598 thanks given
    3. group 70 followers
    1. forum 356 posts
    2. attach_file 80 attachments




 
Search this Thread

Ninja Trader Custom Order Book - 1LDom - Source Code

  #21 (permalink)
 
kalalex's Avatar
 kalalex 
Up the Ladder, CA
 
Experience: Beginner
Platform: SC
Broker: Optimus & AMP
Trading: ES
Posts: 227 since Mar 2011
Thanks Given: 261
Thanks Received: 151


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
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
 
  #22 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,216 since Jan 2011
Thanks Given: 6,752
Thanks Received: 18,136


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
Thanked by:
  #23 (permalink)
 
1LotTrader's Avatar
 1LotTrader 
Douglas, United Kingdom
 
Experience: Advanced
Platform: Custom
Trading: Bund
Posts: 181 since Jun 2009
Thanks Given: 206
Thanks Received: 445



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

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #24 (permalink)
 
1LotTrader's Avatar
 1LotTrader 
Douglas, United Kingdom
 
Experience: Advanced
Platform: Custom
Trading: Bund
Posts: 181 since Jun 2009
Thanks Given: 206
Thanks Received: 445

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
Elite Membership required to download: OneLDOM.cs
Follow me on Twitter Started this thread Reply With Quote
  #25 (permalink)
 
1LotTrader's Avatar
 1LotTrader 
Douglas, United Kingdom
 
Experience: Advanced
Platform: Custom
Trading: Bund
Posts: 181 since Jun 2009
Thanks Given: 206
Thanks Received: 445

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.





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

1Lot

Attached Files
Elite Membership required to download: OneLDOM.cs
Follow me on Twitter Started this thread Reply With Quote
  #26 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,216 since Jan 2011
Thanks Given: 6,752
Thanks Received: 18,136

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
Click image for larger version

Name:	dom.png
Views:	427
Size:	54.2 KB
ID:	89596  
Reply With Quote
  #27 (permalink)
 
1LotTrader's Avatar
 1LotTrader 
Douglas, United Kingdom
 
Experience: Advanced
Platform: Custom
Trading: Bund
Posts: 181 since Jun 2009
Thanks Given: 206
Thanks Received: 445

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:
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.

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #28 (permalink)
 
philipp's Avatar
 philipp 
zürich/ switzerland
 
Experience: None
Platform: NT7, Sierra
Trading: CL
Posts: 128 since Nov 2010
Thanks Given: 48
Thanks Received: 109

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

Reply With Quote
  #29 (permalink)
 
vvhg's Avatar
 vvhg 
Northern Germany
 
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,583 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,824


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
Thanked by:
  #30 (permalink)
 
philipp's Avatar
 philipp 
zürich/ switzerland
 
Experience: None
Platform: NT7, Sierra
Trading: CL
Posts: 128 since Nov 2010
Thanks Given: 48
Thanks Received: 109


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




Last Updated on February 19, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts