I would like to know if it is possible to *simulate* a continuous live feed with quotes to Ninja, (assuming i write a program that produce/generate continuous some fake ticks produced by a random walk) ?
I'm already capable of generating fake data quotes/timestamp, my question is about how to plug it to Ninja so that it see/use it as a continuous live feed ?
Is it possible ? How should i do ?
I've also found some people that explain that "tcp/ip client server communication" may be possible with NT, by the way i didn't found any other information about what kind of network packets that may be sent to NT or what NT expected to receive...
Please notice that i really do want to plug *my own* data progammed live feed and *not use any replay* or demo account ! (for replay accound, unless it can be used in real time)
(i've already successfully imported some historical data inside NT from a text file, but what about if this text file is conunously growing. Or should it be send by a particular protocol ? which one ?)
(i hope that i do not have miss similar question here, i already have asket to The NT guys, but did not get much more help...)
(i'm in the process of buying Ninja to study it and do some backtests, i'm tired ot these other platforms, but i would not be able to afford having real account during this process, and having a 1 or 2 weeks demo won't be enough, also i want tp plug my own data collector to NT...)
For this purpose (fake data quotes) NinjaTrader has a builtin "Simulated Data Feed".
For this purpose you would want to use NinjaTraders builtin "External Data Feed" API:
"This connection targets those traders who have programming experience and wish to create a market data link between their charting or custom application and NinjaTrader which allows them to use the full functionality of NinjaTrader simulator. Please refer to the Ask and Bid functions of the DLL Interface."
Attached is a ZIP file of a simple Windows console client I created for my own use a couple of years ago, I apologise in advance large buckets for the really ugly code but is is a hacked hack of a test harness I created of a hack of a tcp demo and I never had time to rewrite it, you know the sort of story...
It establishes a simple tcp client/server connection, it being the client and expecting a normal tcpListener/tcpSocket type server at the other end to share a simple send-ack protocol between them. You really don't need raw network speed for this sort of application. You could write one the other way around if that was better for you, or use a completely different data link method.
For the NT DLL usage you are only really interested in the block of code in the str.Contains("run") section. It just accepts my own format ascii strings over the tcp connection and uses the NT DLL Bid/Ask/Last calls to feed price and volume data into Ninja. I also implemented my own timestamping mechanism to filter historical data otherwise Ninja puts it all in the last bar of any extant charts, pity.
I have not made use of any of the trade functions so can't help you there. I also optimised data transmission by effectively only sending price changes with accompanying aggregated volume, that worked well for me for minute based charts for many instruments. I haven't loaded it with high speed tick data so couldn't really comment on likely results, but at a guess wouldn't recommend this approach for that.
The strings are basically <instrument name><timestamp><ticksize><price><up volume><down volume> for live data, and an OHLC version for historical data. You may obviously want to use your own formats and approaches to transmission and insertion, as far as Ninja and the DLL are concerned the 'stream' is just a series of DLL calls.
I built it using the free VisualStudio2010 and although well ugly the resulting console application is stable and fast, I don't use it currently but ran it for about 18 months, often 24/7, maybe it can help you get started.
I have no idea what the likely future for the DLL interface is (i.e. with NT8 in mind), only that this approach worked well for me for now, although I would counsel that you can end up spending *way* too much time doing this sort of stuff.
The following 2 users say Thank You to ratfink for this post:
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.