Screenshot: https://paste.pics/152f703e19436d339df102f0a672a89e
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
Strategy not closing unmanaged stopmarket orders on session close
Collapse
X
-
Strategy not closing unmanaged stopmarket orders on session close
I have this unmanaged strategy. On session close, it is closing open positions. But not closing the limit orders and stopmarket orders that I am using as targets and stoploss. I tried using Bars.IsLastBarOfSession to cancel the order manually. But it doesnt seem to work. The strategy is going into the IF block with Bars.IsLastBarOfSession everyday until the previous day but not on the last day.
Screenshot: https://paste.pics/152f703e19436d339df102f0a672a89e
Tags: None
-
Hello fawzanalim,
Is the strategy running with Exit on session close enabled?
If so, I would expect all working orders to be cancelled.
Are you certain the orders are not being re-submitted after the exit on close event?
Below is a link to a forum post with a video that demonstrates the exit on close will cancel all working orders and has an example script of how to prevent new orders after this event.
NinjaTrader Community, A common inquiry is that the Exit on close didn't work in a NinjaScript Strategy because there is a position after the exit on close should have occurred. When viewing the log we often find that the Exit on close does indeed exit the position shortly before the end of the session (based on the Exit on
Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by goodknight777, Today, 08:43 AM
|
1 response
5 views
0 likes
|
Last Post Today, 09:25 AM | ||
Started by kramnor2001, Yesterday, 02:30 PM
|
3 responses
21 views
0 likes
|
Last Post
by kramnor2001
Today, 09:20 AM
|
||
Started by ninza33, Today, 09:10 AM
|
0 responses
8 views
0 likes
|
Last Post
by ninza33
Today, 09:10 AM
|
||
Started by Padan, Today, 02:02 AM
|
3 responses
11 views
0 likes
|
Last Post Today, 08:54 AM | ||
Started by Tim-c, Today, 08:36 AM
|
1 response
3 views
0 likes
|
Last Post Today, 08:45 AM |
Comment