DaveN
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Prevent Stop or Stop Limit orders above the market
Collapse
X
-
Prevent Stop or Stop Limit orders above the market
I have a strategy that runs pretty well, but at least once a day I get the error message "sell or stop limit order can't be placed above the market". When I get this message, it crashes the strategy and stops it. Is there a way to test against the bid ask, in the case of a stop to prevent placing this kind of order, or modify it before it is placed to prevent crashing the strategy?
DaveNTags: None
-
I'm also concerned about this.
When I test my script against Market Data Recorded data with CalculateOnBarClose=true, I've noticed the same thing happens if I enter a Stop order correctly but there is coincidentally a gap in the market after that bar and the Stop is then above/below the market at the time the order attempts execution.
When executing against a real datafeed/broker account, I would be highly surprised if NT would wait for the first tick of the next bar to check this situation. Surely the order is despatched immediately, and the broker would normally just treat it as a Market order if the price had, in the interim, gapped past the stop.
Any comments?
Peter
-
Hello together,
I am working with StopLimitOrders and I use the condition from post #3. So far I get no failure message from NT anymore. But I still have some questions. Which of the following conditions would work probably using StopLimitOrders?
1. stop_entry_price < GetCurrentBid() -> this works...
2. stop_entry_price <= GetCurrentBid()
3. limit_entry_price < GetCurrentBid()
4. limit_entry_price <= GetCurrentBid()
Thanks a lot for your help!
Regards
Michael
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by johnMoss, 03-04-2024, 01:53 PM
|
3 responses
46 views
0 likes
|
Last Post
by AndyM
Today, 06:13 PM
|
||
Started by algospoke, Today, 06:01 PM
|
0 responses
8 views
0 likes
|
Last Post
by algospoke
Today, 06:01 PM
|
||
Started by cre8able, Today, 05:53 PM
|
0 responses
8 views
0 likes
|
Last Post
by cre8able
Today, 05:53 PM
|
||
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
24 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
32 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
Comment