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 175,984 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

  #11 (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


vvhg View Post
I narrowed the error down to this loop(line 2143):
 
Code
foreach (KeyValuePair<string,GLadderClass> ladderIterator in gLadders)
				{....
I had a look with Print() statements, the last ones i got were from inside this loop (three loop runs before the crash to be precise).

Tell me if you need more...

vvhg

yes there are two parts of code that refers to, one is the redraw mapping area and the other is the construction of the ladder itself, maybe you can do me one favour. I have a suspicion it is still the price constant ladder.

Can you switch if off in the parameters and see what is the effect.

Go to the indicator parameters and look for "Price Constant" and set the Show option to "FALSE" instead of true and then try to refresh or reload and see does it still give the same problem?

1Lot

Follow me on Twitter Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Quant vue
Trading Reviews and Vendors
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
 
  #12 (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


1LotTrader View Post
yes there are two parts of code that refers to, one is the redraw mapping area and the other is the construction of the ladder itself, maybe you can do me one favour. I have a suspicion it is still the price constant ladder.

Can you switch if off in the parameters and see what is the effect.

Go to the indicator parameters and look for "Price Constant" and set the Show option to "FALSE" instead of true and then try to refresh or reload and see does it still give the same problem?

1Lot

Without the price constant ladder it works, any way to narrow the error down some more? Where is that part of the code?

vvhg

Hic Rhodos, hic salta.
Reply With Quote
Thanked by:
  #13 (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


thank you vvhg, this is most helpful.

can you try this attached source. I have commented out the code that does some funny stuff with the price constant ladder. If it works I expect you to see a funny price constant but that is fine, so long as it works. Then I know where the problem is.

See attached source file. Just copy over previous source, recompile it and then reload that template. Price Constant ladder must be set back to True so it runs that area of code.

1Lot

Attached Files
Elite Membership required to download: OneLDOM.cs
Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #14 (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


1LotTrader View Post
I have to run out, back in a few hours but I believe I have found the error, I just just need you to confirm on that new source file.

Will work on it later this evening when I get back and hopefully by tomorrow we have seen the last of this blue screen.

1Lot

Works fine now, nice work by the way! If NT8 should not come with a really nice DOM, this might be the startpoint for a full blown custom DOM on steroids....(I said before I'd develop one if the NT guys don't so I might jump on board then...) Next steps could be to stick it into a form, then we could easily set rows to display and so on and then hook it up with chart trader, catch the mouse y price and fire preset orders with one click and even manage them with the ATMs...

vvhg

Hic Rhodos, hic salta.
Reply With Quote
  #15 (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

This is great.
2 great minds work on this together

1Lot's DOM's been working fine for me except for when the market's busy and fast.
It lags seriously.
I don't have the top of line computer and I assumed it is the reason
Anyone tried this during a busy hour?

If it's only me I have a perfect reason to buy a new computer.

Reply With Quote
Thanked by:
  #16 (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


kalalex View Post
This is great.
2 great minds work on this together

1Lot's DOM's been working fine for me except for when the market's busy and fast.
It lags seriously.
I don't have the top of line computer and I assumed it is the reason
Anyone tried this during a busy hour?

If it's only me I have a perfect reason to buy a new computer.

I only had a glance, but my guess would be that it could be optimized quite a bit. Just thinking out loud, so no offense please: It shouldn't be much heavier than my T&S....and it certainly shouldn't lag....
There is some string stuff in the code, that's always expensive...but if it should be optimized, I'd (not saying I will) put it into a separate form and rewrite large chunks. Some code could be stripped down if it wasn't running on a chart... many things could be stored very cheaply in simple int values with an added overflow method...
But all this would take probably weeks to code....

All this is not to discredit @1LotTraders great work but merely to show fields of optimization!

vvhg

Hic Rhodos, hic salta.
Reply With Quote
Thanked by:
  #17 (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

Great news on that find.. I will sort that over the next few days and finally we are rid of that crap bug. I will take my time to make an update as I want to just test it properly. So maybe tomorrow end of day I'll release something.

The issue with market slow down is based on the configuration. What actually slows the DOM down in this format more than anything is in fact the screen refresh rate and redraw of the chart. I have quite powerful machines so I had it turned up when I used it.

It can be the case though where in a fast market the refresh rate becomes to fast and bottlenecks your machine. It is just part of the configuration and one of the reasons I actually created it (ability to tune), if you are using one DOM in one market all day you can afford to raise certain settings. If you are using 3 or 4 on different markets the case is different. With Ninja you have a 1 size fits all and generally it is tuned down so that it will work on everyone's pc's. If I compared mine against the Ninja DOM when it was tuned for my setup it easily outperforms the Ninja stock DOM but as I said must be tuned for your setup.

The tuning options would not be hard to expose. It is mainly the refresh rate and also how many levels in the book will activate a refresh. Ninja themselves are only updating the top bids at a high rate and lower bids at a slower rate, of course they are also limiting to 5 or something where as this DOM exposes all levels of the book.

Ideally for optimal performance you would want a custom form as vvhg has mentioned and start from there. It is not hard and if anyone wanted to take on that project I could offer some help in how to do it.

This DOM was my very first attempt and prototype of a DOM which I was able to throw together fairly quickly with the Gom Volume Footprint as a base, the code is by no means clean or optimal but it is good enough for anyone looking to start out with a book. Ninja's book in my opinion is not very nice to look at. I used this one personally for around 4 months but then built my own book outside of Ninja that routes directly through CQG's API which in the end was a better solution for me personally.

At the end of the day this one can be made to work nicely, I used it for some time and learned to read an order book with it.

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #18 (permalink)
 pbylina 
Chicago, IL
 
Experience: None
Platform: NinjaTrader
Trading: Euro
Posts: 212 since Nov 2010
Thanks Given: 158
Thanks Received: 72


1LotTrader View Post
Ninja themselves are only updating the top bids at a high rate and lower bids at a slower rate, of course they are also limiting to 5 or something where as this DOM exposes all levels of the book.

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



Quoting 
I used this one personally for around 4 months but then built my own book outside of Ninja that routes directly through CQG's API which in the end was a better solution for me personally.

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?:-)

Reply With Quote
  #19 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,236
Thanks Received: 101,660


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?:-)

You can get 10 levels on ES, it will depend on exchange. You can see all 10 levels programatically via NT, but not in the NT DOM.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #20 (permalink)
 pbylina 
Chicago, IL
 
Experience: None
Platform: NinjaTrader
Trading: Euro
Posts: 212 since Nov 2010
Thanks Given: 158
Thanks Received: 72



Big Mike View Post
You can get 10 levels on ES, it will depend on exchange. You can see all 10 levels programatically via NT, but not in the NT DOM.

Mike

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


Reply With Quote
Thanked by:




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