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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
43 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
30 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment