[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
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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 -
BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Skifree, Today, 03:41 AM
|
0 responses
1 view
0 likes
|
Last Post
by Skifree
Today, 03:41 AM
|
||
Started by usazencort, Today, 01:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by usazencort
Today, 01:16 AM
|
||
Started by kaywai, 09-01-2023, 08:44 PM
|
5 responses
603 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
23 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
22 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
Comment