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 176,014 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

  #61 (permalink)
 
Jigsaw Trading's Avatar
 Jigsaw Trading  Jigsaw Trading is an official Site Sponsor
 
Posts: 2,988 since Nov 2010
Thanks Given: 831
Thanks Received: 10,393

It's Euro formatting....

I have the code somewhere - let me dig it out...

Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
What broker to use for trading palladium futures
Commodities
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
 
  #62 (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

had no crash

Reply With Quote
  #63 (permalink)
 
Jigsaw Trading's Avatar
 Jigsaw Trading  Jigsaw Trading is an official Site Sponsor
 
Posts: 2,988 since Nov 2010
Thanks Given: 831
Thanks Received: 10,393


Prices come thru as doubles, so they are unformatted numbers. The numbers from the exchange will be fine. This is an operating system specific issue.

Without looking at the code, I would guess there's some number formatting going on that won't work on PCs with European operating systems where the "," and "." are swapped.

To ensure you get the right separator, you need to use System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator

Visit my NexusFi Trade Journal Reply With Quote
  #64 (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

Freaking commas instead of decimals.. what are you Europeans smoking over there?? lol

Now it makes sense to me why some people were having that crash. I kept thinking, this is impossible what is going on but somehow the process is getting through my coding statement So I changed my code to not kick out the length exception problem by using a Case statement with string compares. Which obviously has stopped the crash but this is still getting through, I'm assuming your TickSizes on instruments show like this then. 0,01?

Thank you for this DionysusToast.

Phillip can you do me one more favour so I can confirm and don't go on a wild goose chase. Can you open your instrument manager and search for Bund and then screen shot it so I can see what your tick size setting looks like in there? I am hoping it is this 0,01.

In the mean time I will start adding some code to catch it.

1Lot

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #65 (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,661

Yes, some countries localization settings use , instead of . for formatting numbers.

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:
  #66 (permalink)
 
Jigsaw Trading's Avatar
 Jigsaw Trading  Jigsaw Trading is an official Site Sponsor
 
Posts: 2,988 since Nov 2010
Thanks Given: 831
Thanks Received: 10,393


1LotTrader View Post
Freaking commas instead of decimals.. what are you Europeans smoking over there?? lol

Now it makes sense to me why some people were having that crash. I kept thinking, this is impossible what is going on but somehow the process is getting through my coding statement So I changed my code to not kick out the length exception problem by using a Case statement with string compares. Which obviously has stopped the crash but this is still getting through, I'm assuming your TickSizes on instruments show like this then. 0,01?

Thank you for this DionysusToast.

Phillip can you do me one more favour so I can confirm and don't go on a wild goose chase. Can you open your instrument manager and search for Bund and then screen shot it so I can see what your tick size setting looks like in there? I am hoping it is this 0,01.

In the mean time I will start adding some code to catch it.

1Lot

Well - I'm English - we use the 9,999.99 format. It's the rest of Europe smoking the left handed cigarettes.

The Instrument.MasterInstrument.TickSize in Ninja will still be a regular double which will be fine. A number is a number, regardless of the Operating System. It'll be number formatting more than likely that gives you issues.

Are you using String.Format or Bars.Instrument.MasterInstrument.FormatPrice anywhere?

Most likely thing is a String.Format with a hard coded "." instead of the System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator

Bund on my US Operating system shows up with 999.99 format.

Visit my NexusFi Trade Journal Reply With Quote
  #67 (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 thanks guys. I have attached a new source.

I tried to change my region to European so that I could replicate and see exactly how it is coming through in the TickSize column but it doesn't seem to alter my ninja settings so I've taken a flying guess I figure the Ticksize can only come through in 1 of 3 ways for Bund:

1. 0.01 (my format)
2. 0,01 (European maybe) - I would've guess this
3. 001 (European maybe) - DionysusToasts comment leads me to think it may be this also.

I have written code to catch all three now so lets see if that solves it. outside chance it puts it through as some other weird conversion but lets see.

1Lot

Attached Files
Elite Membership required to download: OneLDOM.cs
Follow me on Twitter Started this thread Reply With Quote
  #68 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: NinjatraderŽ
Broker: CQG, Kinetick
Trading: Gameplay KlownbineŽ Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

With Level 2 data coming from a TT connection, there is a problem as shown below:

(After I refresh the chart, the erroneous asks below, and bids above, the last price disappear; but then start appearing again as the last price moves.)


Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #69 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,714 since May 2010
Thanks Given: 203
Thanks Received: 2,686

Hi Guys,

I just loosely read this thread... Here is an unsupported tip that might help...again not sure since I just scanned this thread...

string numberDisplay = Bars.Instrument.MasterInstrument.FormatPrice(price, Cbi.Globals.CurrentCulture);

I believe this will return a string representation of the price based on current PC regional settings.

Follow me on Twitter Reply With Quote
  #70 (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



Zondor View Post
With Level 2 data coming from a TT connection, there is a problem as shown below:

(After I refresh the chart, the erroneous asks below, and bids above, the last price disappear; but then start appearing again as the last price moves.)


Go to the options menu, down to the performance area and switch on the IB option. That might sort it. There is a feed specific issue in OnMarketDepth where for some feeds, it does not automatically fire a clear event. This happens on IB, I have never tested the TT feed but it is likely the same problem. Just set it to True and let me know. I'm quite certain that will sort it. I will amend that option to say IB/TT - can you confirm for me?

Follow me on Twitter Started this thread 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