Strategy to monitor ALL account orders? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Strategy to monitor ALL account orders?
Updated: Views / Replies:4,632 / 18
Created: by SetFreeByTruth Attachments:1

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 1  
 
Thread Tools Search this Thread
 

Strategy to monitor ALL account orders?

  #11 (permalink)
Elite Member
Asia
 
Futures Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 786 received


traderwerks View Post
What about something like zeromq in brokerless mode ? Also, there is the windows messaging framework, but I haven't kept up with that one.

Way, way OT but I'd love to find a way to turn this into the Poor Man's TIBCO

NetFPGA

Reply With Quote
 
  #12 (permalink)
Just starting out...
Minneapolis Minnesota
 
Futures Experience: Advanced
Platform: Metatrader
Favorite Futures: Forex
 
SetFreeByTruth's Avatar
 
Posts: 5 since Mar 2011
Thanks: 2 given, 0 received


MXASJ View Post
Have a play with this:

 
Code
Print("Total Open Positions: " + Account.Positions.Count);
System.Collections.IEnumerator ListPositions = Account.Positions.GetEnumerator();
for (int i = 0; i < Account.Positions.Count; i++)
{
ListPositions.MoveNext();
Print("Open Position: " + ListPositions.Current);
}
Please post back if you come up with something useful. I need to send position information to another computer and have not come up with an elegant way to do it yet.

Thank you! That is just what I was looking for. I also see I can use the Account.Orders collection to iterate over orders:

 
Code
int iOrderCount = Account.Orders.Count;
 				
Print("Total Open Orders: " + iOrderCount );
System.Collections.IEnumerator ListOrders = Account.Orders.GetEnumerator();
			
for (int i = 0; i < iOrderCount; i++) {
  ListOrders.MoveNext();
  Print("  Open Orders: " + ListOrders.Current );
}
I wonder why the Account object isn't documented in the NT help file. Anyway, thank you!


Last edited by SetFreeByTruth; March 31st, 2011 at 04:27 PM. Reason: Add code snippet
Reply With Quote
 
  #13 (permalink)
Elite Member
San Antonio
 
Futures Experience: Advanced
Platform: NinjaTrader Interactive Brokers
Broker/Data: Interactive Brokers
Favorite Futures: forex
 
Posts: 45 since Oct 2010
Thanks: 0 given, 116 received

Need to determine the strategy UniqueID


I am attempting to trigger an ATM strategy from the SuperDom and then want to find it from a strategy (that is attached to a chart) and execute advanced trail logic that is not possible with an ATM. Specifically, I'm building a strategy that trails behind the 15m bar on a bar by bar basis. But it also, changes it's stop management 15 minutes before or after news. News is downloaded from Forex Factory via their xml interface live from within the strategy. The interface, which is a hidable side panel, will eventually list the news events and allow you to select which news to pay attention to and which to ignore.

I used the code in this thread to enumerate the Strategy collection, but it doesn't contain the strategy's UniqueID. I need the UniqueId to use AtmStrategyChangeStopTarget().

Here is the code I used:
 
Code
                            
            Print("Total Strategies: " Account.Strategies.Count);
            
System.Collections.IEnumerator ListStrategies Account.Strategies.GetEnumerator();

            for (
int i 0Account.Strategies.Counti++)
            {
                
ListStrategies.MoveNext();
                Print(
"Open Strategy: " ListStrategies.Current);
            } 
I also tried this without success:
 
Code
                            
            foreach (IStrategyData strat in StrategyData)
            {
                
//do something
            

One option is to put buttons on my panel to create the entry and ATM from within the strategy. Then I would know the UniqueID, but this reduces flexability to add the trailing stop after the entry is made.

Any ideas?

Attached Thumbnails
Strategy to monitor ALL account orders?-screen-shot-2011-04-02-9.37.37-am.png  

Last edited by sam028; April 2nd, 2011 at 07:21 PM. Reason: spelling, and add coding tag
Reply With Quote
 
  #14 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,573 given, 3,982 received

@richtobey, an option is maybe to look in the NT database directly, the ID might be there.
I'm writing something like your 2nd option: a strategy with some buttons on an other panel, but without using ATM. That's very flexible.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #15 (permalink)
Elite Member
Cluj-Napoca Cluj/Romania
 
Futures Experience: Intermediate
Platform: NinjaTrader, MetaTrader 4
Broker/Data: FXCM, Continuum
Favorite Futures: Forex, Futures
 
Posts: 12 since Apr 2013
Thanks: 6 given, 6 received

Calling to Each Order's parameters

G'day guys,

I know I am resurrecting a dead horse here but none the less I need some help in tweaking this idea further.

I have followed and implemented the following code:
 
Code
int ioCount = account.Orders.Count;
System.Collections.IEnumerator ListOrders = account.Orders.GetEnumerator();
for (int i = 0; i < ioCount; i++) {
	ListOrders.MoveNext();
	Print("  Open Orders: " + ListOrders.Current);
}
Do you guys know of a method or a way to call to each individual order properties (like price) so I can use it in code further.

Thanks in advance,

Maza.

Reply With Quote
 
  #16 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


Maza View Post
G'day guys,

I know I am resurrecting a dead horse here but none the less I need some help in tweaking this idea further.

I have followed and implemented the following code:
 
Code
int ioCount = account.Orders.Count;
System.Collections.IEnumerator ListOrders = account.Orders.GetEnumerator();
for (int i = 0; i < ioCount; i++) {
	ListOrders.MoveNext();
	Print("  Open Orders: " + ListOrders.Current);
}
Do you guys know of a method or a way to call to each individual order properties (like price) so I can use it in code further.

Thanks in advance,

Maza.

You can just use the Orders directly, e.g.

 
Code
Order myOrder = account.Orders[i];
Print(myOrder.OrderType);

Travel Well
Reply With Quote
The following user says Thank You to ratfink for this post:
 
  #17 (permalink)
Elite Member
Cluj-Napoca Cluj/Romania
 
Futures Experience: Intermediate
Platform: NinjaTrader, MetaTrader 4
Broker/Data: FXCM, Continuum
Favorite Futures: Forex, Futures
 
Posts: 12 since Apr 2013
Thanks: 6 given, 6 received

Thanks and one more Question


ratfink View Post
You can just use the Orders directly, e.g.

 
Code
Order myOrder = account.Orders[i];
Print(myOrder.OrderType);

Firstly I would like to thank you ratfink for your timely answer.

I still have one more question that I can't find the answer to. How can I see (from code) what account is selected in the chart trader?

Thanks again,

Maza.

Reply With Quote
The following user says Thank You to Maza for this post:
 
  #18 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


Maza View Post
Firstly I would like to thank you ratfink for your timely answer.

I still have one more question that I can't find the answer to. How can I see (from code) what account is selected in the chart trader?

Thanks again,

Maza.

 
Code
		private void accountChanged (object sender, EventArgs e)
		{
			if (ChartControl != null)
			{
				if (ChartControl.ChartTraderEnabled && ChartControl.ChartTraderVisible)
				{
					acDbg("accountChanged, ChartTrader is enabled and visible");
					
					try
					{
						ctrAccount = (ComboBox)ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Controls["cboAccount"];
						acDbg("ctrAccount " + ctrAccount);
						if (ctrAccount != null)
						{
							ctrSelectedAccount = (Account) ctrAccount.SelectedItem;
							acDbg("ctrSelectedAccount " + ctrSelectedAccount);
							if (ctrSelectedAccount != null)
							{
								mySelectedAccount = ctrSelectedAccount.Name.ToString();
								acDbg("mySelectedAccount " + mySelectedAccount);
								if (mySelectedAccount != "")
								{
									acDbg("accountName was " + accountName + " and now " + mySelectedAccount);
									accountName = mySelectedAccount;	// override ChartMinder Executions account
									
									connectMyAccount("ChartTrader");
								}
							}
						}
					}
					catch { acDbg("failed getting a/c change"); }
					
					acDbg("out accountChanged");
				}
			}
		}
		
		
		
		private void attachToChartTrader ()
		{
			acDbg("attachToChartTrader CC " + ChartControl);
			
			if (ChartControl != null)
			{
				if (ChartControl.ChartTraderEnabled && ChartControl.ChartTraderVisible)
				{
					acDbg("ChartTrader enabled and visible");
					
					try
					{
						ctrAccount = (ComboBox)ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Controls["cboAccount"];
						acDbg("ctrAccount " + ctrAccount);
						if (ctrAccount != null)
						{
							ctrSelectedAccount = (Account) ctrAccount.SelectedItem;
							acDbg("ctrSelectedAccount " + ctrSelectedAccount);
							if (ctrSelectedAccount != null)
							{
								ctrAccount.SelectedValueChanged += new EventHandler(accountChanged);
								mySelectedAccount = ctrSelectedAccount.Name.ToString();
								acDbg("mySelectedAccount " + mySelectedAccount);
								if (mySelectedAccount != "")
								{
									acDbg("accountName was " + accountName + " now " + mySelectedAccount);
									accountName = mySelectedAccount;	// override ChartMinder Executions account
									
									connectMyAccount("ChartTrader");
								}
							}
						}
					}
					catch { acDbg("attach failed"); }
				}
				else
				{
					acDbg("No ChartTrader");
				}
			}
			
			acDbg("out attach");
		}
So basically, 'attachToChartTrader' sets up an event handler callback to 'accountChanged' and you can access the control's value in there or directly.

If you want the full gory story check out my ChartMinder thread.

Cheers

Travel Well
Reply With Quote
The following user says Thank You to ratfink for this post:
 
  #19 (permalink)
Elite Member
Cluj-Napoca Cluj/Romania
 
Futures Experience: Intermediate
Platform: NinjaTrader, MetaTrader 4
Broker/Data: FXCM, Continuum
Favorite Futures: Forex, Futures
 
Posts: 12 since Apr 2013
Thanks: 6 given, 6 received

Wow!!!


ratfink View Post
 
Code
		private void accountChanged (object sender, EventArgs e)
		{
			if (ChartControl != null)
			{
				if (ChartControl.ChartTraderEnabled && ChartControl.ChartTraderVisible)
				{
					acDbg("accountChanged, ChartTrader is enabled and visible");
					
					try
					{
						ctrAccount = (ComboBox)ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Controls["cboAccount"];
						acDbg("ctrAccount " + ctrAccount);
						if (ctrAccount != null)
						{
							ctrSelectedAccount = (Account) ctrAccount.SelectedItem;
							acDbg("ctrSelectedAccount " + ctrSelectedAccount);
							if (ctrSelectedAccount != null)
							{
								mySelectedAccount = ctrSelectedAccount.Name.ToString();
								acDbg("mySelectedAccount " + mySelectedAccount);
								if (mySelectedAccount != "")
								{
									acDbg("accountName was " + accountName + " and now " + mySelectedAccount);
									accountName = mySelectedAccount;	// override ChartMinder Executions account
									
									connectMyAccount("ChartTrader");
								}
							}
						}
					}
					catch { acDbg("failed getting a/c change"); }
					
					acDbg("out accountChanged");
				}
			}
		}
		
		
		
		private void attachToChartTrader ()
		{
			acDbg("attachToChartTrader CC " + ChartControl);
			
			if (ChartControl != null)
			{
				if (ChartControl.ChartTraderEnabled && ChartControl.ChartTraderVisible)
				{
					acDbg("ChartTrader enabled and visible");
					
					try
					{
						ctrAccount = (ComboBox)ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Controls["cboAccount"];
						acDbg("ctrAccount " + ctrAccount);
						if (ctrAccount != null)
						{
							ctrSelectedAccount = (Account) ctrAccount.SelectedItem;
							acDbg("ctrSelectedAccount " + ctrSelectedAccount);
							if (ctrSelectedAccount != null)
							{
								ctrAccount.SelectedValueChanged += new EventHandler(accountChanged);
								mySelectedAccount = ctrSelectedAccount.Name.ToString();
								acDbg("mySelectedAccount " + mySelectedAccount);
								if (mySelectedAccount != "")
								{
									acDbg("accountName was " + accountName + " now " + mySelectedAccount);
									accountName = mySelectedAccount;	// override ChartMinder Executions account
									
									connectMyAccount("ChartTrader");
								}
							}
						}
					}
					catch { acDbg("attach failed"); }
				}
				else
				{
					acDbg("No ChartTrader");
				}
			}
			
			acDbg("out attach");
		}
So basically, 'attachToChartTrader' sets up an event handler callback to 'accountChanged' and you can access the control's value in there or directly.

If you want the full gory story check out my ChartMinder thread.

Cheers

Ratfink,

I had a look at your "ChartMinder" software and I have to say, you rocked my world!!! I am trying to build something way more rudimentary than what you have there.

I have to thank you for the work that you have put into this indicator and just for the time that you have taken to respond to my posts.

With respect,

Maza.

Reply With Quote
The following user says Thank You to Maza for this post:

Reply



futures io > > > > > Strategy to monitor ALL account orders?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
paper account real account interactive brokers Mehdi IB Trader Workstation 15 January 6th, 2012 12:16 PM
What is going on here (my strategy isn't producing orders) ???? jmejedi NinjaTrader Programming 5 June 7th, 2011 08:11 PM
6 monitor deskstand Ryanb Tech Support 40 April 16th, 2011 08:42 PM
Need Help with simple strategy on canceling orders floyd084 NinjaTrader Programming 2 February 22nd, 2011 02:34 AM
Strategy market orders zeller4 NinjaTrader Programming 5 August 27th, 2009 01:11 AM


All times are GMT -4. The time now is 06:57 PM.

Copyright © 2017 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
Page generated 2017-12-13 in 0.14 seconds with 20 queries on phoenix via your IP 54.90.92.204