Order Status (OnOrderUpdate) in indicator? - futures io
futures io futures trading



Order Status (OnOrderUpdate) in indicator?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vantojo with 5 posts (4 thanks)
    2. looks_two Blash with 2 posts (0 thanks)
    3. looks_3 asfax with 1 posts (2 thanks)
    4. looks_4 ratfink with 1 posts (1 thanks)
    1. trending_up 1,379 views
    2. thumb_up 7 thanks given
    3. group 4 followers
    1. forum 9 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Order Status (OnOrderUpdate) in indicator?

(login for full post details)
  #1 (permalink)
Neuquen, Argentina
 
Experience: Intermediate
Platform: Ninja
Trading: CL, TF, 6S, NG, sometimes GC
 
Posts: 200 since Jul 2012
Thanks: 25 given, 42 received

Calling NT Gurus....

Is there any way to get the functionality of OnOrderUpdate in an Indicator?

The orders are submitted by the indicator through OIF or an automated Chart Trader button press.

Thanks

Started this thread Reply With Quote
The following user says Thank You to vantojo for this post:

Can you help answer these questions
from other members on futures io?
Neurological explanations for trading Success
Psychology and Money Management
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
Volume Profile Indicator for Ninja Script in NT8
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
137 thanks
Big Mike in Ecuador
34 thanks
Want your NinjaTrader indicator created, free?
32 thanks
Saturday Morning Market Replay!
20 thanks
Selling Options on Futures?
19 thanks
 
(login for full post details)
  #3 (permalink)
Market Chamois
Chicago, IL
 
Experience: None
Platform: NT8,NT7,TWS
Broker: InteractiveBrokers, S5T, IQFeed
Trading: The one I'm creating in the present....Index Futures mini/micro, ZF
 
Blash's Avatar
 
Posts: 2,274 since Nov 2011
Thanks: 7,191 given, 4,414 received



vantojo View Post
Calling NT Gurus....

Is there any way to get the functionality of OnOrderUpdate in an Indicator?

The orders are submitted by the indicator through OIF or an automated Chart Trader button press.

Thanks

NT8 or NT7 please.............?

...My calamity is My providence, outwardly it is fire and vengeance, but inwardly it is light and mercy...
The steed of this Valley is pain; and if there be no pain this journey will never end.
Buy Low And Sell High (read left to right or right to left....lol)
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #4 (permalink)
Neuquen, Argentina
 
Experience: Intermediate
Platform: Ninja
Trading: CL, TF, 6S, NG, sometimes GC
 
Posts: 200 since Jul 2012
Thanks: 25 given, 42 received

This is for NT7.....

Quite awhile before I port to NT8.

Thanks

Started this thread Reply With Quote
The following user says Thank You to vantojo for this post:
 
(login for full post details)
  #5 (permalink)
Birmingham UK
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
 
ratfink's Avatar
 
Posts: 3,651 since Dec 2012
Thanks: 17,422 given, 8,403 received


vantojo View Post
Calling NT Gurus....

Is there any way to get the functionality of OnOrderUpdate in an Indicator?

The orders are submitted by the indicator through OIF or an automated Chart Trader button press.

Thanks

Only way I found was by searching account.Orders.

Code in rfkChartMinder but simpler in rfkChartOrders:



Cheers

Travel Well
Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to ratfink for this post:
 
(login for full post details)
  #6 (permalink)
Market Chamois
Chicago, IL
 
Experience: None
Platform: NT8,NT7,TWS
Broker: InteractiveBrokers, S5T, IQFeed
Trading: The one I'm creating in the present....Index Futures mini/micro, ZF
 
Blash's Avatar
 
Posts: 2,274 since Nov 2011
Thanks: 7,191 given, 4,414 received


vantojo View Post
This is for NT7.....



Quite awhile before I port to NT8.



Thanks



I completely understand.

But, I just wanted to emphasize the massive improvement over NT7 with NT8. Gone are the one chart dominates or Market Analyzer etc on loading or refreshing .... over the entire NT7 platform etc etc

Ron


Sent from my iPhone using futures.io

...My calamity is My providence, outwardly it is fire and vengeance, but inwardly it is light and mercy...
The steed of this Valley is pain; and if there be no pain this journey will never end.
Buy Low And Sell High (read left to right or right to left....lol)
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #7 (permalink)
Neuquen, Argentina
 
Experience: Intermediate
Platform: Ninja
Trading: CL, TF, 6S, NG, sometimes GC
 
Posts: 200 since Jul 2012
Thanks: 25 given, 42 received

Yes, probably lots of improvements in NT8....but I think they still separate Strategy base from Indicator base code...that is many methods for orders and positions probably are still not available in the indicator base?

Is that true?

I trade primarily from the chart and have had to write a lot of code to do it the way I need/want. My indicators are a hybrid....they can submit orders or just let me manually place trades with a single click, et cetera. Automated exits (not ATM), etc.

That means porting a good portion of my code to NT8 is probably going to be a big effort.

Unless NT8 has dissolved the difference between an indicator and a strategy, I am going to wait as long as I can to port.

Started this thread Reply With Quote
 
(login for full post details)
  #8 (permalink)
Neuquen, Argentina
 
Experience: Intermediate
Platform: Ninja
Trading: CL, TF, 6S, NG, sometimes GC
 
Posts: 200 since Jul 2012
Thanks: 25 given, 42 received

will study the code you point to

Started this thread Reply With Quote
The following user says Thank You to vantojo for this post:
 
(login for full post details)
  #9 (permalink)
Prague, Czech Republic
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: NQ
 
Posts: 56 since Sep 2009
Thanks: 33 given, 75 received


vantojo View Post
Calling NT Gurus....

Is there any way to get the functionality of OnOrderUpdate in an Indicator?
The orders are submitted by the indicator through OIF or an automated Chart Trader button press.
Thanks

Hi @vantojo
I am not sure if your problem is still actual, however I solve this problem in an Indicator (NT7) by using own version of OnOrderUpdate() and by subscribe OrderStatusEventHandler().
 
Code
protected override void OnStartUp()
{
   //...
   foreach (NinjaTrader.Cbi.Account a in NinjaTrader.Cbi.Globals.Accounts)
   {
      a.OrderStatus += new OrderStatusEventHandler(OnOrderUpdate); // subscribe handler for all accounts

      // subscribe another useful event handlers
      // a.Execution += new ExecutionUpdateEventHandler(OnExecution);
      // a.PositionUpdate += new PositionUpdateEventHandler(OnPositionUpdate);
      // a.Connection.ConnectionStatus += new ConnectionStatusEventHandler(OnConnectionStatus);
      // a.AccountUpdate += new AccountUpdateEventHandler(OnAccountUpdate);
   }
   //...
}

protected override void OnTermination()
{
   //...
   foreach (NinjaTrader.Cbi.Account a in NinjaTrader.Cbi.Globals.Accounts)
   {
      a.OrderStatus -= OnOrderUpdate;	// unsubscribe handler

      // unsubscribe another useful event handlers
      // a.Execution -= OnExecution;
      // a.PositionUpdate -= OnPositionUpdate;
      // a.Connection.ConnectionStatus -= OnConnectionStatus;
      // a.AccountUpdate -= OnAccountUpdate;

   }
   //...
}

// handle event
private void OnOrderUpdate(object sender, OrderStatusEventArgs e)
{
   if (e.Order.Account == acc && e.Order.Instrument == Instrument)  // order status changed for order on my account and instrument only
   {
      // do something useful
      Print(e.Order.ToString());	
      Print("Order state = " + e.Order.OrderState);
      Print("Order action = " + e.Order.OrderAction)
      if (e.Order.OverFill)	
      {
         // handle overfill
      }		
      // etc
   }
}

// private void OnExecution(object sender, ExecutionUpdateEventArgs e)
// {
//     ...
// }

// private void OnPositionUpdate(object sender, PositionUpdateEventArgs e)
// {
//     ...
// }

// private void OnConnectionStatus(object sender, ConnectionStatusEventArgs e)
// {
//     ...
// }

// private void OnAccountUpdate(object sender, AccountUpdateEventArgs e)
// {
//     ...
// }

Reply With Quote
The following 2 users say Thank You to asfax for this post:
 
(login for full post details)
  #10 (permalink)
Neuquen, Argentina
 
Experience: Intermediate
Platform: Ninja
Trading: CL, TF, 6S, NG, sometimes GC
 
Posts: 200 since Jul 2012
Thanks: 25 given, 42 received


Yes, it looks like this is a much better solution that what I came up with...which was to scan the Cbi account and order collections each time I needed to get an update on order status (in an indicator)

I'm not really a C# guy but have been able to do amazing things by reading code here at Futures.IO and of course, from suggestions and tips from its members.

Thank you Asfax, as well as everyone here.

Started this thread Reply With Quote
The following user says Thank You to vantojo for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Order Status (OnOrderUpdate) in indicator?


Last Updated on January 20, 2017


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 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