Creating a data feed connection provider for NT - NinjaTrader Programming | futures io social day trading
futures io futures trading


Creating a data feed connection provider for NT
Updated: Views / Replies:3,861 / 43
Created: by rleplae Attachments:2

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
 2  
 
Thread Tools Search this Thread
 

Creating a data feed connection provider for NT

  #21 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,488 since Sep 2013
Thanks: 1,703 given, 3,691 received
Forum Reputation: Legendary

you don't need another machine, but you need to create a program that will deliver
the datafeed, in case of your own symbols. on the diagram it is the red box called
new data provider. it is a program that will listen to requests from the proxy and
deliver the data in the right format.

Reply With Quote
 
  #22 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received


gztanwei View Post
Understand the concept , but how can we Point IQFeed to my own Database source?? are we need to build another machine to be "IQFeed" Server ? I would like to do something similar , which Point I need to start ??

In few words:
- in Ninja connect to the External Data Feed
- write a small program which will:
-> connect to port 36973 (the External Data Feed listening port)
-> read your data (csv, SQL, whatever...)
-> send these data through this socket
In Python sending the ask price will looks like this:
 
Code
                            
self.s.send('1\x00')

self.s.send('0\x00')
self.s.send(instrument+'\x00')
self.s.send(ask+'\x00')
self.s.send(volume+'\x00')
self.s.send(dateTime+'\x00'
The second char sent is '0' for ask, '1' for bid, '2' for last.

If everything works you should be able to feed Ninja with whatever you want, like on this
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following user says Thank You to sam028 for this post:
 
  #23 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,488 since Sep 2013
Thanks: 1,703 given, 3,691 received
Forum Reputation: Legendary



sam028 View Post
In few words:

-> connect to port 36973 (the External Data Feed listening port)
-> read your data (csv, SQL, whatever...)
-> send these data through this socket
In Python sending the ask price will looks like this:
 
Code
                            
self.s.send('1\x00')

self.s.send('0\x00')
self.s.send(instrument+'\x00')
self.s.send(ask+'\x00')
self.s.send(volume+'\x00')
self.s.send(dateTime+'\x00'
The second char sent is '0' for ask, '1' for bid, '2' for last.

This is the ATI interface, this not the native external data feed.
You can also call the NTdirect.dll function (which inside will do the socket thing as @sam028 explains)

The DLL Interface functions are contained in NTDirect.dll located in the C:\WINDOWS\system32 folder.

DLL Interface Functions
int Ask(string instrument, double price, int size)
Sets the ask price and size for the specified instrument. A return value of 0 indicates success and -1 indicates an error.

int AskPlayback(string instrument, double price, int size, string timestamp)
Sets the ask price and size for the specified instrument for use when synchronizing NinjaTrader playback with an external application playback. A return value of 0 indicates success and -1 indicates an error. The timestamp parameter format is "yyyyMMddhhmmss".


int Bid(string instrument, double price, int size)
Sets the bid price and size for the specified instrument. A return value of 0 indicates success and -1 indicates an error.

int BidPlayback(string instrument, double price, int size, string timestamp)
Sets the bid price and size for the specified instrument for use when synchronizing NinjaTrader playback with an external application playback. A return value of 0 indicates success and -1 indicates an error. The timestamp parameter format is "yyyyMMddhhmmss".

For one instrument this can work, for many instruments this has a performance issue
Personally i found the NTdirect and the ATI interface to be very buggy, especially if you make multiple connections
with theardown, there is a memory leak inside somewhere

Reply With Quote
 
  #24 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,488 since Sep 2013
Thanks: 1,703 given, 3,691 received
Forum Reputation: Legendary

With a true data provider interface, you can make various charts, any bar, tick, 1 min, 5 min, 1 hour,
daily, etc and any other type of chars, as NT will request the data that it needs through the dataprovider
interface as and when it needs the data.

Depending on what you want to do , you can write a data provider or you can push data, one by one
to NT through the NTdirect.dll interface (or the direct socket way as @sam028 explained) , these are two
different options to get your data inside NT.

For the data provider interface, you can 'mimick' any existsing interface that NT has.

You can 'reverse engineer an interface' like @sam028 did, or you can take an interface that is documented
and implement it as documented (iqfeed progammers spec, IFX standard, any other documented I/F)

These are just a few options...


Last edited by rleplae; December 3rd, 2016 at 12:06 PM. Reason: typos
Reply With Quote
 
  #25 (permalink)
Trading Apprentice
navi mumbai
 
Futures Experience: Beginner
Platform: NINJATRADER
Favorite Futures: GOLD
 
Posts: 7 since Nov 2016
Thanks: 0 given, 0 received

Query


sam028 View Post
You can do this using the External connector, but it won't allow another regular data feed.
If you want a custom data feed to run in parallel with a regular one an option would be create a fake IB connector for example, instead of using the external connector. As the IB API is well documented I assume it won't be too painful to create a service/daemon which will reply to NT requests in a coherent format.

Please can elaborate it a bit more. I am not a coder and looking for a freelancer to do it for me. But I don't even understand what should I exactly tell him. Would indeed be a great help if you could just briefly explain how it can be done.
thank you.

Reply With Quote
 
  #26 (permalink)
Trading Apprentice
navi mumbai
 
Futures Experience: Beginner
Platform: NINJATRADER
Favorite Futures: GOLD
 
Posts: 7 since Nov 2016
Thanks: 0 given, 0 received


rleplae View Post
With a true data provider interface, you can make various charts, any bar, tick, 1 min, 5 min, 1 hour,
daily, etc and any other type of chars, as NT will request the data that it needs through the dataprovider
interface as and when it needs the data.

Depending on what you want to do , you can write a data provider or you can push data, one by one
to NT through the NTdirect.dll interface (or the direct socket way as @sam028 explained) , these are two
different options to get your data inside NT.

For the data provider interface, you can 'mimick' any existsing interface that NT has.

You can 'reverse engineer an interface' like @sam028 did, or you can take an interface that is documented
and implement it as documented (iqfeed progammers spec, IFX standard, any other documented I/F)

These are just a few options...

Sir, how to write a data provider?? If its not too much of trouble please can you explain it briefly.
thank you

Reply With Quote
 
  #27 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,488 since Sep 2013
Thanks: 1,703 given, 3,691 received
Forum Reputation: Legendary


33rdvirus View Post
Sir, how to write a data provider?? If its not too much of trouble please can you explain it briefly.
thank you

There are many ways you can skin this cat.

1. You can create a FIX server and connect NT to your own FIX server.
FIX specifications are open and free

Tech / Specs - FIX Trading Community

2. You can 'mimic' one of the existing protocols (iqfeed, rithmic

3. As mentioned before, you can also use the NTDirect.dll, if you are
talking about smaller amount of data.

4. You can also call data from an indicator, and then draw the chart.

It all depends what problem you are trying to solve ?

Reply With Quote
 
  #28 (permalink)
Trading Apprentice
navi mumbai
 
Futures Experience: Beginner
Platform: NINJATRADER
Favorite Futures: GOLD
 
Posts: 7 since Nov 2016
Thanks: 0 given, 0 received


rleplae View Post
There are many ways you can skin this cat.

1. You can create a FIX server and connect NT to your own FIX server.
FIX specifications are open and free


2. You can 'mimic' one of the existing protocols (iqfeed, rithmic

3. As mentioned before, you can also use the NTDirect.dll, if you are
talking about smaller amount of data.

4. You can also call data from an indicator, and then draw the chart.

It all depends what problem you are trying to solve ?

Hello. You being an elite member, I really didn't expect such a quick reply. But thank you for that. My exact problem is, my broker released rest-like APIs sometime back and they are (obviously) not supported by ninjatrader. So I searching for a way to connect ninjatrader with my broker, to place orders and receive live & historical data from the same connection.
thank you.

Reply With Quote
 
  #29 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,488 since Sep 2013
Thanks: 1,703 given, 3,691 received
Forum Reputation: Legendary


33rdvirus View Post
Hello. You being an elite member, I really didn't expect such a quick reply. But thank you for that. My exact problem is, my broker released rest-like APIs sometime back and they are (obviously) not supported by ninjatrader. So I searching for a way to connect ninjatrader with my broker, to place orders and receive live & historical data from the same connection.
thank you.

OK

Then you don't only need a datafeed, but also a broker (order) connection.

You could take the rithmic spec's or the IB spec's and make a bridge.

This would look like this :

NT -> {rithmic or IB} <-- you bridge app --> {your broker rest APIs}

you bridge app would then be responsible for parsing and mapping back and forward.
that belongs to the kind of 'heavy' lifting category, not easy but not impossible.

Reply With Quote
 
  #30 (permalink)
Trading Apprentice
navi mumbai
 
Futures Experience: Beginner
Platform: NINJATRADER
Favorite Futures: GOLD
 
Posts: 7 since Nov 2016
Thanks: 0 given, 0 received



rleplae View Post
OK

Then you don't only need a datafeed, but also a broker (order) connection.

You could take the rithmic spec's or the IB spec's and make a bridge.

This would look like this :

NT -> {rithmic or IB} <-- you bridge app --> {your broker rest APIs}

you bridge app would then be responsible for parsing and mapping back and forward.
that belongs to the kind of 'heavy' lifting category, not easy but not impossible.

And sir where can I find rithmics spec's or IB spec's? and by specs do you mean the protocol?

Reply With Quote

Reply



futures io > > > > > Creating a data feed connection provider for NT

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is DTN IQ Feed a data feed provider? What broker/platforms can I use? shots fired Reviews of Brokers and Data Feeds 4 May 10th, 2015 02:57 PM
NT data feed Bergsra Reviews of Brokers and Data Feeds 3 January 10th, 2015 01:50 PM
Broker / Data feed provider djiym German Traders 29 November 20th, 2013 03:46 AM
Data Feed and Internet Connection Quality with ADSL 2+ Laurus12 Reviews of Brokers and Data Feeds 16 October 2nd, 2013 11:17 PM
ninja data feed provider stocks ciardim Reviews of Brokers and Data Feeds 3 October 24th, 2011 08:03 AM


All times are GMT -4. The time now is 07:17 AM.

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.08 seconds with 19 queries on phoenix via your IP 54.196.182.102