NinjaTrader open orders and positions summary? - NinjaTrader Programming | futures io social day trading
futures io futures trading


NinjaTrader open orders and positions summary?
Updated: Views / Replies:3,026 / 3
Created: by drmartell Attachments:0

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
 
Thread Tools Search this Thread
 

NinjaTrader open orders and positions summary?

  #1 (permalink)
Elite Member
Portland, OR
 
Futures Experience: Intermediate
Platform: NinjaTrader mostly
Broker/Data: I've tried 'em all
Favorite Futures: ZN, ES, 6E, TF, CL
 
drmartell's Avatar
 
Posts: 94 since Mar 2010
Thanks: 176 given, 78 received

NinjaTrader open orders and positions summary?

Anyone know if it is possible to write NinjaScript that will loop through and display information about all open orders and positions across all accounts?

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,286 received



drmartell View Post
Anyone know if it is possible to write NinjaScript that will loop through and display information about all open orders and positions across all accounts?

 
Code
for (int i=0; i < NinjaTrader.Cbi.Globals.Accounts.Count; i++ ) {
    for (int j=0; j < NinjaTrader.Cbi.Globals.Accounts[i].Positions.Count; j++ ) {
        Print(" "
            +NinjaTrader.Cbi.Globals.Accounts[i].Name +" "
            +NinjaTrader.Cbi.Globals.Accounts[i].Positions[j].Instrument.FullName +" "
            +NinjaTrader.Cbi.Globals.Accounts[i].Positions[j].MarketPosition +" "
            +NinjaTrader.Cbi.Globals.Accounts[i].Positions[j].Quantity +" "
            +NinjaTrader.Cbi.Globals.Accounts[i].Positions[j].AvgPrice
        );
    }
}

Reply With Quote
The following 3 users say Thank You to monpere for this post:
 
  #4 (permalink)
Elite Member
Portland, OR
 
Futures Experience: Intermediate
Platform: NinjaTrader mostly
Broker/Data: I've tried 'em all
Favorite Futures: ZN, ES, 6E, TF, CL
 
drmartell's Avatar
 
Posts: 94 since Mar 2010
Thanks: 176 given, 78 received

monpere to the rescue! thank you.

I'm going to add in some reporting on the open orders something along these lines, for what it's worth. . .

 
Code
[protected override void OnStartUp()
{
	for (int i=0; i < NinjaTrader.Cbi.Globals.Accounts.Count; i++ ) {
		for (int j=0; j < NinjaTrader.Cbi.Globals.Accounts[i].Positions.Count; j++ )
		{
			Print(""
				+NinjaTrader.Cbi.Globals.Accounts[i].Name +" "
				+NinjaTrader.Cbi.Globals.Accounts[i].Positions[j].Instrument.FullName +" "
				+NinjaTrader.Cbi.Globals.Accounts[i].Positions[j].MarketPosition +" "
				+NinjaTrader.Cbi.Globals.Accounts[i].Positions[j].Quantity +" "
				+NinjaTrader.Cbi.Globals.Accounts[i].Positions[j].AvgPrice
			);
		}
		
		for (int j=0; j < NinjaTrader.Cbi.Globals.Accounts[i].Orders.Count; j++ ) 
		if (NinjaTrader.Cbi.Globals.Accounts[i].Orders[j].Filled == 0 && NinjaTrader.Cbi.Globals.Accounts[i].Orders[j].OrderState.ToString() != "Cancelled")
		{
			Print(""
				+NinjaTrader.Cbi.Globals.Accounts[i].Name +" "
				+NinjaTrader.Cbi.Globals.Accounts[i].Orders[j].Instrument.FullName +" "
				+NinjaTrader.Cbi.Globals.Accounts[i].Orders[j].OrderAction + " "
				+NinjaTrader.Cbi.Globals.Accounts[i].Orders[j].Quantity +" "
				+NinjaTrader.Cbi.Globals.Accounts[i].Orders[j].OrderType + " "
				+NinjaTrader.Cbi.Globals.Accounts[i].Orders[j].LimitPrice + " "
				+NinjaTrader.Cbi.Globals.Accounts[i].Orders[j].StopPrice + " "
			);
		}
	}
}

Reply With Quote
The following 2 users say Thank You to drmartell for this post:

Reply



futures io > > > > > NinjaTrader open orders and positions summary?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only
 

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exit open positions based on time guppy EasyLanguage Programming 6 March 25th, 2018 12:13 PM
Ninjatrader simple code to exit all L and S positions at a particular time. birdoggg NinjaTrader 2 October 16th, 2012 01:06 AM
Ninjatrader Bracket orders 393mach1 NinjaTrader 19 March 6th, 2012 09:08 AM
Which trading software permit limitation of open orders quantity Slava23 Platforms and Indicators 8 February 16th, 2012 06:00 AM
How to cancel any existing open orders, if there are any, hcoffin1941 NinjaTrader Programming 3 October 23rd, 2011 04:36 AM


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

Copyright © 2018 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 2018-05-25 in 0.08 seconds with 19 queries on phoenix via your IP 23.20.7.34