Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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.
Can you help answer these questions from other members on NexusFi?
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:
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 screenshot (forget about the very sophisticated GUI )
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
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)
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.
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
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.
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.
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?