if(Open[0] >= Close[1] && Close[0] < Open[1] && Open[1] < Close[1])
{
Print("Buying Short");
stopOrder = EnterShortStopMarket(High[0]);
Print("Stop Order: " + stopOrder.ToString());
ordersEntered = true;
return;
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
why isn't the EnterShortStopMarket or Long working?
Collapse
X
-
why isn't the EnterShortStopMarket or Long working?
I'm calling this method and I keep getting the "Sell stop or sell stop limit orders can't be placed above the market..." error
Code: -
Hello brettcomardelle93,
A sell stop market order must be below the bid, just like when placing manual orders.
Are you certain that High[0] is less than GetCurrentBid()?
Are you using prints to make sure that High[0] is less than GetCurrentBid()?
Chelsea B.NinjaTrader Customer Service
-
To be clear, the EnterShortStopMarket() should short at the market price and then set a stop at the price provided, right?
If it isn't, and I have to place something lower than the High[0], than this isn't doing what I need it to do.
I am wanting to buy at the close[0] and set a stop at the High[0] if the close is less than the high.
In the case of a short on a red candle, it should be true. The High[0] would be higher than the Close[0]
I just need a sliver of code that shows how to do this. On bar close, buy at the close[0] (or market if I can't use limit) and also set the loss to be equal to the High of that bar (if short).
Comment
-
Hello brettcomardelle93,
A stop market order is placed above the ask for a buy and below the bid for a sell and fills at the current market price when touched.
If you want a sell order below the bid, this will need to be a limit order or market-if-touched order (which is a simulated order).
Try placing these orders manually on the SuperDOM or ChartTrader to understand how to place orders.
https://ninjatrader.com/support/foru...546#post562546
An entry sell limit order can be placed above the bid with EnterShortLimit(). Below is a link to the help guide.
https://ninjatrader.com/support/help...shortlimit.htm
Where you have mentioned:
"I am wanting to buy at the close[0] and set a stop at the High[0] if the close is less than the high."
This will not be possible. Targets which are limit orders are placed above the entry for a long position, stop losses which are stop orders are placed below the entry.
A long exit limit order can be placed with ExitLongLimit().
https://ninjatrader.com/support/help...tlonglimit.htmLast edited by NinjaTrader_ChelseaB; 08-26-2020, 03:51 PM.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
31 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment