NexusFi: Find Your Edge


Home Menu

 





NT7, NT8- Get Feed of Price Change to Method/Event & Confirm Order


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one ieitani with 4 posts (0 thanks)
    2. looks_two sam028 with 2 posts (0 thanks)
    3. looks_3 rleplae with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 1,470 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread

NT7, NT8- Get Feed of Price Change to Method/Event & Confirm Order

  #1 (permalink)
ieitani
Tel Aviv
 
Posts: 10 since Feb 2016
Thanks Given: 1
Thanks Received: 1

Hi All,

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

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
What broker to use for trading palladium futures
Commodities
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863



ieitani View Post
Hi All,

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

you can test the fill on an order with the interface

int Filled(string orderId)
Gets the number of contracts/shares filled for the orderId.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
ieitani
Tel Aviv
 
Posts: 10 since Feb 2016
Thanks Given: 1
Thanks Received: 1


rleplae View Post
you can test the fill on an order with the interface

int Filled(string orderId)
Gets the number of contracts/shares filled for the orderId.



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.

Thanks for your reply.

Isaac

Reply With Quote
  #5 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

@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.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #6 (permalink)
ieitani
Tel Aviv
 
Posts: 10 since Feb 2016
Thanks Given: 1
Thanks Received: 1


sam028 View Post
@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

Reply With Quote
  #7 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


ieitani View Post
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.



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.

You can also call OrderStatus.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


ieitani View Post
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

See MulticastOption Class on how to do it and here for what's IP Multicast.

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.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #9 (permalink)
ieitani
Tel Aviv
 
Posts: 10 since Feb 2016
Thanks Given: 1
Thanks Received: 1


sam028 View Post
@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.


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.

Thanks,
Isaac

Reply With Quote




Last Updated on July 9, 2016


© 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