NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

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.

Reply
 
Thread Tools Display Modes
Old 03-01-2007, 02:25 AM   #1
Oli
Member
 
Join Date: Feb 2007
Location: , ,
Posts: 83
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

If CurrentPosition = 0, ie flat, can this command [NTClosePosition] still be safely used?

It won't cause any errors on instruments without a current position will it?
Oli is offline  
Reply With Quote
Old 03-01-2007, 03:33 AM   #2
NinjaTrader_Ryan
NinjaTrader Customer Service
 
NinjaTrader_Ryan's Avatar
 
Join Date: Sep 2006
Location: Denver, CO, USA
Posts: 620
Thanks: 10
Thanked 2 times in 2 posts
Post imported post

Hello Oli:

Thank you for your post.

According to your post, if your current position is already flat (=0), then clicking the 'Close' button will not cause errors since you are already flat. If you left click on the 'Close' button, it will flatten your position if you have a current position in the SuperDOM.

Please clarify for me your question. Do you mean if I have multiple SuperDOM's open and click the 'Close' button, will it flatten all of my current positions?

Best regards,

Ryan
NinjaTrader_Ryan is offline  
Reply With Quote
Old 03-01-2007, 03:48 AM   #3
Oli
Member
 
Join Date: Feb 2007
Location: , ,
Posts: 83
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

sorry for not being clear there,

NTClosePosition() is a command issued as part of an ATI script, not from within NT
Oli is offline  
Reply With Quote
Old 03-01-2007, 04:32 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

It's safe.

Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 12-10-2010, 07:34 PM   #5
Bluepoint
Member
 
Join Date: Dec 2009
Posts: 42
Thanks: 0
Thanked 3 times in 1 post
Default Definition question for NT Commands

I want to use NT Commands, spefically; NTClosePosition

Currently running NJ7 and IB. Perahps a silly question but how do i get the strategy
being developed to recognise the functions. Get a compile error that the command does not exist. Any simple examples?

Actually I want to NTFlattenEverything for only a said account if it violates a CashValue. But I think this NTFlattenEverything all accounts. Best way?
Bluepoint is offline  
Reply With Quote
Old 12-11-2010, 10:32 AM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

BluePoint,

These commands are not for a NinjaScript automated strategy.

They're used in our ATI interface for processing external signals through NinjaTrader.

With NinjaScript, you flatten positions with:
ExitLong();
ExitShort();

There are new account properties in version 7:
http://www.ninjatrader.com/support/h...countvalue.htm

This sample offers examples on using the performance class for money management:
http://www.ninjatrader-support.com/v...ead.php?t=4084
NinjaTrader_RyanM is offline  
Reply With Quote
Old 12-11-2010, 11:43 AM   #7
Bluepoint
Member
 
Join Date: Dec 2009
Posts: 42
Thanks: 0
Thanked 3 times in 1 post
Default

Yes but will the :

ExitLong();
ExitShort();

Flatten the account even though the strategy to did not create the original entry?
Bluepoint is offline  
Reply With Quote
Old 12-11-2010, 05:42 PM   #8
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

No, these will only apply to positions opened by the strategy. Unfortunately there aren't supported methods that offer this, but you may want to check out the undocumented / unsupported thread for some ideas.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 12-13-2010, 12:35 AM   #9
Bluepoint
Member
 
Join Date: Dec 2009
Posts: 42
Thanks: 0
Thanked 3 times in 1 post
Default Hints that can flatten for 1 account only not all

Thanks NinjaTrader_RyanM.

Can you give any more hints that can flatten for 1 account only not all account connections?
Bluepoint is offline  
Reply With Quote
Old 12-13-2010, 03:07 AM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
Default

Quote:
Originally Posted by Bluepoint View Post
Thanks NinjaTrader_RyanM.

Can you give any more hints that can flatten for 1 account only not all account connections?
Bluepoint, this is unfortunately not supported as Ryan already pointed out.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 11:15 PM.