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 08-13-2012, 06:29 PM   #16
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
Default

Ken,

What exactly do you mean by catch all? What are you trying to accomplish with the quantity
NinjaTrader_Matthew is offline  
Reply With Quote
Old 08-14-2012, 04:28 AM   #17
kenb2004
Senior Member
 
Join Date: Jul 2010
Posts: 415
Thanks: 1
Thanked 4 times in 4 posts
Default

Mathew

I need to exit All Open Long Positions at the Limit Price. That was the purpose of the emtpy ("") tag that Bertrand mentioned in post#10. These are unique entries. So is there a way to exit ALL instead of specifying an "int" in the quantity property? Scaling in then ALL out.
Thanks
kenb2004 is offline  
Reply With Quote
Old 08-14-2012, 04:49 AM   #18
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello kenb2004,
Instead of cancelling the first target you can simply change it and submit a new 2nd target.

Code:
if (buy2entry != null && buy2entry == order)
{ 
    if (order.OrderState == OrderState.Filled) 
    {
       //update the existing limit order
         ExitLongLimit(ExitLongLimit(0, true, 1, Position.AvgPrice + 4 * TickSize, "Buy_1Profit", "Buy_1Entry");
         //submit a new order
	 ExitLongLimit(ExitLongLimit(0, true, 1, Position.AvgPrice + 4 * TickSize, "Buy_2Profit", "Buy_2Entry");
			
      
    }
}
Please let me know if I can assist you any further.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 08-14-2012, 09:14 AM   #19
kenb2004
Senior Member
 
Join Date: Jul 2010
Posts: 415
Thanks: 1
Thanked 4 times in 4 posts
Default

Why do you have 2 ExitLongLimit(ExitLongLimit.... in your code?
kenb2004 is offline  
Reply With Quote
Old 08-14-2012, 09:17 AM   #20
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello kenb2004,
To assist you further may I know what is your entry codes?

I look forward to assisting you further.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 08-14-2012, 09:30 AM   #21
kenb2004
Senior Member
 
Join Date: Jul 2010
Posts: 415
Thanks: 1
Thanked 4 times in 4 posts
Default

This is my entry code:
Quote:
if (condtion)
buy1entry = EnterLongLimit(0, true, 1, Buy_1EntryPrice, "Buy_1");
kenb2004 is offline  
Reply With Quote
Old 08-14-2012, 09:40 AM   #22
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello kenb2004,
In post 13 you have referred to the following code:
Code:
protected override void OnOrderUpdate(IOrder order)
{
if (buy2entry != null && buy2entry == order)
Can you tell me what is the buy2entry IOrder do?

Can you please send a toy NinjaScript code* describing the exact scenario you are facing to support[AT]ninjatrader[DOT]com

Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

I look forward to assisting you further.

*The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
NinjaTrader_Joydeep 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
Scaling in and Scaling out question regarding commissions MicroTrends Automated Trading 4 07-04-2010 07:57 AM
Scaling In rnr123 Strategy Analyzer 1 08-31-2009 07:23 AM
Scaling in, Scaling out by differing poritions of total account size tooearly Automated Trading 6 08-10-2009 09:48 AM
Scaling In and Out PeterBrazel ATM Strategies (Discretionary Trading) 1 06-11-2009 05:09 AM
Scaling Richard Von Suggestions And Feedback 3 08-21-2007 01:44 PM


All times are GMT -6. The time now is 07:45 PM.