Many thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Split order
Collapse
X
-
Split order
I would like to split an enter long order on 10 contracts into 10 enter long order on 1 contracts. Is there an easy way to do that in strategies?
Many thanks -
Hello paul.cabot,
So I can best answer your question, would you be able to provide more information?
Instead of submitting a buy order for 10 contracts you wish to submit 10 orders for 1 contract each when your buy condition becomes true?
I look forward to your reply.Alan P.NinjaTrader Customer Service
-
yes, exactly, I want to submit 10 orders for 1 contract each when your buy condition becomes true
This is to break the 10 contracts order into 10 smaller orders
Thanks
Comment
-
Hello paul.cabot,
To do this I sent EnteryHandling to Unique Entries and uniquely named 10 different EnterLong calls.
Please see EntryHandling section of our helpguide and import the attached sample.
Please let us know if you need further assistance.
.
To Import a NinjaScript into NinjaTrader 8 do the following:
From the Control Center window select Tools -> Import-> NinjaScript...
Find the file location.Attached FilesAlan P.NinjaTrader Customer Service
Comment
-
Yes, use a loop. The 'order object' is no different than before.
To submit an order with a random quantity Y between 1 and 4 until X contracts
have been submitted, you first need a way to get a random number,
then makeup a function, something like,Code:private static Random MyRand = new Random(DateTime.Now.Millisecond);
which works well with these 'direction' integer constants,Code:private void EnterOrder(int Direction, int totalQuantity) { int orderNum = 1; while (totalQuantity > 0) { int quantity = Math.Min(MyRand.Next(1, 4), totalQuantity); if (Direction > 0) EnterLong(quantity, "L"+orderNum); else if (Direction < 0) EnterShort(quantity, "S"+orderNum); totalQuantity = totalQuantity - quantity; ++orderNum; } }
then, to enter random orders for a 10 contract position, call it like this,Code:private const int SHORT = -1; private const int NONE = 0; private const int LONG = 1;
Make sense?Code:EnterOrder(LONG, 10);
- Likes 1
Comment
-
-
Hello elliot5,
The above information was specifically for the Managed approach and does not specify any targets. In this specific case the Signal Name of each entry could be used for the targets because that is how the managed appraoch associates Entries with Targets.
For unmanaged you would instead submit the targets yourself. There is a sample of an unmanaged strategy which submits targets as OCO in the following link, that would be the suggested approach at unmanaged targets. https://ninjatrader.com/support/foru...elp#post770579
Please let me know if I may be of additional assistance.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
546 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment