[FONT=Courier New][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (Positions[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].MarketPosition==MarketPosition.Flat && Positions[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].MarketPosition==MarketPosition.Flat)
{
LongEntry=EnterLongLimit([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],Contracts,myprice[/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"LEntry"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);
ShortEntry=EnterShortLimit([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],Contracts,[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]myprice[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"SEntry"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);
}
[/SIZE][/FONT]
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Placing multiple orders
Collapse
X
-
Placing multiple orders
I have the following code. My buy order is being placed immediately, and I can see my sell order in the trace log, however the sell order does not show up in the ninja gui. Anyone know why?
Code:Tags: None
-
You are likely running into one of these Internal Order Handling Rules: http://www.ninjatrader-support.com/H...verview36.htmlJosh P.NinjaTrader Customer Service
-
I don't see an answer from the link. I have EntriesPerDirection=1 and EntryHandling=UniqueEntries. My entries are both unique, and they are in opposite directions, so I don't understand why that wouldn't work.
The link provided mentioned BarsInProgress, but since I am sending both orders on Instrument #1, I would think that if 1 goes they should both go.
Comment
-
Methods that generate orders (excluding market orders) to enter a position will be ignored if:- The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
Josh P.NinjaTrader Customer Service
Comment
-
-
-
Please have a look at this sample here - http://www.ninjatrader.com/support/f...ead.php?t=3751
You can either use the SetTrailStop() method, or adjust your SetStopLoss() values as needed -
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
152 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
89 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
131 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
127 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment