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 > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 10-28-2007, 06:32 PM   #1
richa61416
Senior Member
 
Join Date: Jun 2007
Location: Anguilla
Posts: 140
Thanks: 0
Thanked 0 times in 0 posts
Default How does Ninja Close a Position.

I am curious as to the method in which NInja Closes a strategy position.
If I am in a position as follows: Long Entry. Profit target 20 ticks, StopLoss 10 Ticks. If my strategy detects a change in market direction, and I trigger exit using the ExitLong command.

Would NinjaTrader first cancel the ProfitTarget and StopLoss entry orders, and then execute a Sell Order,

or it Executes the Sell Order, then cancells the ProfitTarget and StopLoss orders.
richa61416 is offline  
Reply With Quote
Old 10-28-2007, 06:37 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

It should execute sell and then cancel stop/profit. You can use TraceOrders to watch the exact behavior of your orders.

http://www.ninjatrader-support.com/H...aceOrders.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 10-28-2007, 06:51 PM   #3
richa61416
Senior Member
 
Join Date: Jun 2007
Location: Anguilla
Posts: 140
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Josh. I was thinking so, when I saw an error stating exceeded Margin. I guess Ninja has a good reason for performing it that way. My problem is, it affects my contract that can be traded, without incurring a margin error, when trying to exit.

Is there a way I can cancel the order generated by
SetProfitTarget(
), so that It doesn't appear to my broker as if I want to trade an extra contract, when I really want to exit?
richa61416 is offline  
Reply With Quote
Old 10-28-2007, 10:26 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

This will be more doable in NT6.5, but for now perhaps you could try just modifying the profit target order to bring it down to the price you want to exit at?

http://www.ninjatrader-support.com/v...ead.php?t=3222
NinjaTrader_Josh 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strategy order with name "Close Position" ThePatientOne Strategy Development 30 09-03-2010 12:16 PM
Position.GetProfitLoss(Close[0], PerformanceUnit.Points) problems scriabinop23 Strategy Development 2 05-18-2007 12:22 PM
Open position on close down andrewedmondson ATM Strategies (Discretionary Trading) 3 10-05-2005 07:02 AM
long a contract with no way to close the position flip Miscellaneous Support 1 09-19-2005 05:46 AM
Ninja dumping all position strategies upon reconnect TraderPete Automated Trading 5 01-26-2005 02:20 PM


All times are GMT -6. The time now is 02:22 PM.