![]() |
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 |
|
|
#16 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
Ken,
What exactly do you mean by catch all? What are you trying to accomplish with the quantity
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#17 |
|
Senior Member
Join Date: Jul 2010
Posts: 415
Thanks: 1
Thanked 4 times in 4 posts
|
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 |
|
|
|
|
|
#18 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
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");
}
}
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#19 |
|
Senior Member
Join Date: Jul 2010
Posts: 415
Thanks: 1
Thanked 4 times in 4 posts
|
Why do you have 2 ExitLongLimit(ExitLongLimit.... in your code?
|
|
|
|
|
|
#20 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello kenb2004,
To assist you further may I know what is your entry codes? I look forward to assisting you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#21 | |
|
Senior Member
Join Date: Jul 2010
Posts: 415
Thanks: 1
Thanked 4 times in 4 posts
|
This is my entry code:
Quote:
|
|
|
|
|
|
|
#22 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
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 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.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |