![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Mar 2008
Posts: 69
Thanks: 0
Thanked 0 times in 0 posts
|
Today I started using my new full version of NT with IB. I'm using NT to route futures day trading orders from Tradestation to IB.
I was going to use the "time to flatten" checkbox feature to flatten my futures day trading positions but then I realized that this feature would probably flatten all of my manually-entered long-term stock holdings in my IB account, so I turned off the feature a few minutes before it was going to probably cause major havok. Am I correct in assuming that this feature will completely flatten EVERYTHING in my IB account at the time specified? Is there a way to tell NT to only flatten the futures positions, or those initiated today? Thank you in advance. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Wow...good thing you disabled that since YES! your entire acccount(s) at IB would be flat.
What you can do is enable Exit on close for each strategy running.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2008
Posts: 69
Thanks: 0
Thanked 0 times in 0 posts
|
Yeah that's what I thought.
Glad I turned it off.The reason I wanted to use the feature was because my strategy exits at 16:00 EST (at the close) and there tends to be a lot of slippage a few seconds before and after the exact close at 16:00, so I had set the timer to like 30 seconds because the close (15:59:30) or something like that. When I was trading my strategy manually at Mirus with the direct edition of Ninja, that's what I would do. I suppose I could just exit at 15:55 or 16:05 (using 5 minute bars) instead of right on the 16:00 close bar, though that is not what my backtested / walked-forwarded strategy prescribes. Thanks for the info. |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Dec 2006
Location: Seattle, Washington, USA
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
|
Does it depend on brokerage's technology?
For example, Patsystem only tells NinjaTrader the Account's PnL. So, "Flatten All Positions" would only flatten the trades that NinjaTrader knows about and it might not flatten all positions in the brokerage account. Correct? |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Not sure I follow. NT knows all trades in our broker account and knows the actual position of your broker account and thus knows what to do to flatten out any pending position.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Dec 2006
Location: Seattle, Washington, USA
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
|
http://www.ninjatrader-support.com/v...ing+technology
If there are 5 NT-initiated trades and 10 non-NT-initiated trades in the brokerage account, NT only knows about the 5 NT-initiated trades. According to the link above, NT only gets PnL. NT doesn't know about the non-NT-initiated trades. Thus, when NT flattens everything, the 10 non-NT-initated trades are still open in the brokerage account. That's what I meant. |
|
|
|
|
|
#7 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Not sure where on link below you read that. Flattening an account is driven by positions and open orders and not PnL.
NT always is aware of any open order/position in an account as it connects to this account.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Jun 2008
Posts: 146
Thanks: 0
Thanked 0 times in 0 posts
|
Regarding stopping a strategy, I wonder if there is a way to stop a strategy and flatten position + cancel all orders associated with it only (e.g. if I have other strategies running concurrently, as well as trades placed manually outside of NT, they all should stay intact upon such a stop). I tried to use something like ExitLong( Position.Quantity ), but it flattens every single position for a given instrument. Thank you!
|
|
|
|
|
|
#9 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
Sorry for the delay. You will find examples on how to do this here: http://www.ninjatrader-support.com/v...ead.php?t=4804
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Jun 2008
Posts: 146
Thanks: 0
Thanked 0 times in 0 posts
|
Great, I will check these out. Thank you Ben
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Flatten Everything Suggestion | Moog | Suggestions And Feedback | 5 | 02-04-2008 06:49 AM |
| Time to flatten vs. Exit on close | dtf139 | Automated Trading | 1 | 01-11-2008 07:11 AM |
| Flatten ALL - closes all positions, not just those open/managed by NT | zoltran | Miscellaneous Support | 7 | 03-23-2007 07:00 PM |
| Options Misc Flatten | bmaltz | SuperDOM and other Order Entry Windows | 3 | 02-02-2007 10:48 AM |
| FLATTENALL does not flatten non-AT created positions in NT ... ? | mkundi | Automated Trading | 1 | 06-26-2005 11:34 PM |