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)
NT7, NT8- Get Feed of Price Change to Method/Event & Confirm Order
I work on an API for NT, running by DLL (NinjaTrader.Client.dll, not DtDirect.dll [couldn't load]).
Have my app with VS 2013, then connecting to NT and managed to send orders successfully.
I NEED:
1. Subscribe
I know from other API that it is possible to subscribe to the Market Data of an instrument/contract, and then I get into a Method/Function any tick / price change.
Is is possible with NT API?
I ask that like with other APIs (OEC), I could subscribe then get per price/tick change, or when position chagned.
I get trigger when order got filled, etc...
I need the same with my App on my VS.
I have posted this on NT forum:
Sorry can't post link...
on NinjaTrader.com's Forum go to.
NinjaTrader Support Forum > Application Technical Support > Automated Trading
Get Feed of Price Change to Method/Event & Confirm Order
They say that NT don't push data outside to the DLL.
But, I look for the best practice.
I don't feel comfortable to run a loop few times a second, then check with so many calls if anything changed.
It don't sound right, and I want to make it right.
I need to subscribe to price change or tick change or position change and get the trigger inside my code in VS.
Is it possible?
Will you help/guide?
2. Order Confirmation.
How I can confirm (from C# code) that order got filled, and get the details on that order, e.g. Fill price..
I got it with OEC, and I got it with FIX protocol.
Why not with NT?
In other words, dose NT push information to the application?
I know by relating the Method (with right signature) to the socket, then I can get information from NT and not only send.
Thank you,
Isaac
Can you help answer these questions from other members on NexusFi?
Thank you for the reply anyhow.
It means first that I need to know my order id, but when I send Command to PLACE an order, I receive only 0 for success, and I don't get an order id.
It is true that i could find order id on Orders(account), but all orders are there.
So, I cannot manage my orders with the DLL interface.
I could do that with OEC, so I don't have the benefit/ability to write a robust application, that could run/control a strategy.
I don't want to put my code inside Ninja Trader (strategy)...
I want it external..
Same like I can do with any broker that work with FIX protocol.
Can I get price/tick change inside my method in my VS environment?
Can I get a trigger of a method to tell me that my position got filled, with information on it's fill?
Or, what is the best practice?
Should I request many times in one second, and see if any changes?
I don't think it is right coding.
@ieitan, for #1 I'll suggest using OnMarketData(): if the last price is different from the previous one, send the information (using a multicast socket for example).
For #2 the easier is to use the same principle with a proxy strategy which will listen for orders to be sent (socket, ZeroMQ, ...) and will report the order status (with OnBarUpdate()) using the same channel.
Will you elaborate "Multicast Socket"?
technically, how do I do it?
The DLL, don't have an Event to delegate OnMarketDatta().
I guess that I do have it inside a strategy, then how do I push it to my DLL?
If I have managed to do that, then maybe I do have a solution.
Very nice to see how in this website (futures.io), answers comes in a high rates.
So much faster than the original NT Forum.
Thank you, but PLEASE. Be more specific than Laconic.
Isaac
When you place your order, give it a reference: (eg : orderId = Guid.NewGuid().ToString("N") )
You then can trace it for execution with he fill example i gave you.
Your DLL don't have to use any NT libraries/classes, it will use multicast to receive information, from a Ninja strategy (last price is X, order Z was filled, ...).
Unicast sockets will also work but using multicast allows multiple DLL/receivers which can be useful and efficient.
Can you be more specific?
I did not manage to trigger OnMarketData() method on Strategy.
I got the idea that I could from that method, send by socket to my application. But, it is new for me.
For this case, I will need a complete tutorial, or a link to a tutorial.
1. How to trigger OnMarketData() and how to make subscription to the price change of a contract, per tick, or per price change.
2. How to get trigger when an order got filled.
3. After I have the above tirggered, How to write the code to send by socket the data to my code in my VS.C#.
Please be specific.
p.s. in this forum, I get response fast. In NinjaTrader.com's forum it can take few business days for a response.
Thank you.