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,626 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

  #141 (permalink)
 miallvro 
az
 
Experience: Intermediate
Platform: tos
Broker: tos td ib
Trading: futures
Posts: 5 since Apr 2010
Thanks Given: 0
Thanks Received: 1

Yeah CME guys need to subscribe if they want the full book I believe. Retail really gets the fist when it comes to stuff like this.

I trade /TF and have the level 2 on the chart - similar to the one found on the NT forums.

TF = WIN

Follow me on Twitter Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
33 thanks
Just another trading journal: PA, Wyckoff & Trends
28 thanks
Tao te Trade: way of the WLD
23 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #142 (permalink)
 miallvro 
az
 
Experience: Intermediate
Platform: tos
Broker: tos td ib
Trading: futures
Posts: 5 since Apr 2010
Thanks Given: 0
Thanks Received: 1

I swore I saw more than 10 levels available on a subscription basis - I could be wrong. I can't find anything about it now.

Follow me on Twitter Reply With Quote
  #143 (permalink)
 
Surly's Avatar
 Surly 
denver, colorado
 
Experience: Intermediate
Platform: NT
Trading: ZS
Posts: 704 since Mar 2011
Thanks Given: 628
Thanks Received: 1,263


Thanks @1LotTrader! This looks like a great resource, eager to see it in action tomorrow (just installed today). I am having trouble setting the indicator's default values for the width of the various columns. I set them all to -30 with a smaller font (12) so I can see more on my screen - however when I ask NT to set these values as default I cannot. Any advice for me? I find that even if I save my workspace, the chart still comes up with the default (0) width values. Also, when I save the setup as a new template, it still reverts to zero rather than the -30 I want.

Sorry if this is more to do with NT than with this specific indicator but thanks in advance for any help!

surly

Seek freedom and become captive of your desires. Seek discipline and find your liberty. - Frank Herbert
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #144 (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

No worries, I'll have a look. I remember having a similar issue some years ago and can't remember off hand how I resolved it. Very likely I have done something funny with the parameters. Will check and let you know.

1Lot

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #145 (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, new source attached, that was the result of some real sloppy late night coding on my part. I copied and pasted some XMLignore stuff that I shouldn't have and forgot to Serialize the Font properties.

Should be ok now, let me know if it's good.

Thanks
1Lot

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

Really nice work with your order book.
I'm still thinking about how to give it the ability to trade from it....
Tapping into ChartTrader would be no problem, market orders, close, reverse, limit @bid/ask would be at our fingertips. But to execute orders at a specific level that is not enough...
Maybe, though unlikely, we could find a way to change the price on the latter...
The other way would be to see if we find a way to use the right click menu:
[img]https://nexusfi.com/v/4nxemv.jpg[/img]

The question would be if the event raised by this carries the price information with it and can thus be manipulated or if it straps the mouse y "under the hood" to get the price.

The other difficulty would be making sure to avoid any patent issues...

vvhg

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

Yes there are a number of complicating factors. Specifically around entering orders and some others like the simulation environment itself which gives out some glorious fills. It was for these reasons that in the end I moved off of it and to my own stuff which I wrote from scratch.

The patent thing I believe is a non-issue. I did some research and it seems that in order for TT's DOM patent to stand up, one must violate all issues in the patent, I've read through it and these include a number of things. If just one element is different then the patent is no longer valid.

In this case it does not match TT's patent on a number of grounds but a key one is that their patent covers a static price ladder. In this instance because it is done on the chart and the chart has automatic vertical Y scaling on the underlying data series it could not be considered static.

It is not immediately evident but the price scale is in fact moving at times and this is happening automatically which would make it dynamic.

I believe this in itself brings the DOM outside any potential patent issues.

So adding one click order entry functionality is rather an issue of whether it's worth the effort given the base is not ideal in the first place. In terms of carrying it out, i believe it would either be a case of creating some hit boxes on the chart that align with the bid/ask blocks or you get the co-ordinates from the chart and convert to the Y Values.

I know it's possible to grab the price with the mouse as I've seen some other guys doing some stuff with it. The only thing I am unsure of is if they used some sort of function like HitTest and whether those results will extend to the full chart area or just the underlying data series which would be an issue.

Have a look at these couple of links for ideas of getting chart co-ordinates. I have not checked what Ninja has exposed in this regard but it will give you some ideas:

c# - Getting x-coordinate on Chart from mouse click - Stack Overflow

c# - finding the value of the [AUTOLINK]points[/AUTOLINK] in a chart - Stack Overflow

Cheers
1Lot

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #148 (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 a number of complicating factors. Specifically around entering orders and some others like the simulation environment itself which gives out some glorious fills. It was for these reasons that in the end I moved off of it and to my own stuff which I wrote from scratch.

The patent thing I believe is a non-issue. I did some research and it seems that in order for TT's DOM patent to stand up, one must violate all issues in the patent, I've read through it and these include a number of things. If just one element is different then the patent is no longer valid.

In this case it does not match TT's patent on a number of grounds but a key one is that their patent covers a static price ladder. In this instance because it is done on the chart and the chart has automatic vertical Y scaling on the underlying data series it could not be considered static.

It is not immediately evident but the price scale is in fact moving at times and this is happening automatically which would make it dynamic.

I believe this in itself brings the DOM outside any potential patent issues.

So adding one click order entry functionality is rather an issue of whether it's worth the effort given the base is not ideal in the first place. In terms of carrying it out, i believe it would either be a case of creating some hit boxes on the chart that align with the bid/ask blocks or you get the co-ordinates from the chart and convert to the Y Values.

I know it's possible to grab the price with the mouse as I've seen some other guys doing some stuff with it. The only thing I am unsure of is if they used some sort of function like HitTest and whether those results will extend to the full chart area or just the underlying data series which would be an issue.

Have a look at these couple of links for ideas of getting chart co-ordinates. I have not checked what Ninja has exposed in this regard but it will give you some ideas:

c# - Getting x-coordinate on Chart from mouse click - Stack Overflow

c# - finding the value of the [AUTOLINK]points[/AUTOLINK] in a chart - Stack Overflow

Cheers
1Lot

Getting the price of a y value is very easy, but to trade from it I believe the order book should rather be in its own form, not too different from eg. vvAggregatedTS or similar. This way it would be easy to add some nice buttons for order entry and ideally fields for account ATM strategy and quantity. The trick would be to execute the context menu entries from code at a programmatically set price level.
I guess at that level we would do something to stay well clear of the TT patent, just to make sure. That shouldn't be too hard, I already have got a few ideas.

vvhg

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

Yes a separate form is better but then essentially you will be starting it again from scratch, which then begs the question why bother writing it in Ninja if you are going to write custom forms, may as well write standalone and have complete control. This was the conclusion I came to myself.

Regards the actual placing of orders on Ninja and management, ATM's and all the rest of it I can't really offer much on that as I didn't delve to deeply into it. The ATI allows for order placing through the DLL interface but it is hardly ever updated and I'm not sure how much control it allows. Only other way around that would be finding some unsupported exposed functions I guess.

Again though if you go through all this hassle, is it worth it? if you want to build it from scratch adding all these layers adds extra unnecessary time. You see what I did in the end, I wrote a completely standalone book and then hooked it directly into CQG's interface. There are so many advantages for instance, going via this route, I was able to get CQG to reconfigure my account set up to route directly through there main European data Centre, as close to Eurex without the bouncing to the United States that will happen with many other connections and account types.

At the end of the day it's just a question of where do you want to take it and how far do you want to go, time to invest etc., for me, once having decided to undertake the task, adding all these unnecessary endless layers/wrappers made no sense.

I stripped it all out and went to the source . My book orders average around 40m/s working on Eurex, some days better but rarely worse. The main amount of time I give up is between my house and the main port, i live on an island in a rural setting and the line is not as great quality from here to the port, it takes as much time to go from my house to the port as it does the whole trip to Frankfurt and back. At the end of the day I could make it even faster but I like the smell of cowsh!t in the morning, so what can you do.. lol

1Lot

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #150 (permalink)
 
Surly's Avatar
 Surly 
denver, colorado
 
Experience: Intermediate
Platform: NT
Trading: ZS
Posts: 704 since Mar 2011
Thanks Given: 628
Thanks Received: 1,263


apologies for asking this q here: I copied the .cs file into my /bin/custom folder but do I need to change the name to match the .cs file already there before I compile? thanks!

Seek freedom and become captive of your desires. Seek discipline and find your liberty. - Frank Herbert
Visit my NexusFi Trade Journal 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