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
Unrecognized Orders
Collapse
X
-
Unrecognized Orders
At one minute before the close of every hour, I want to close all orders in process and all pending orders. NinjaScript does not seem flexible enough to handle this, so I created a strategy (attached) with CalculateOnBarClose False that calls (in Sets 3 through 10) to ExitLong and ExitShort at one minute before the end of each hour beginning with 1:59 AM and ending with 8:59 AM. The ExitLong and ExitShort are not being executed. Why? Also, how do I close all pending hours at one minute before the end of each hour?Tags: None
-
Running on 60 minute chart. What do you mean by "a corresponding timestamp to trigger your exits?" I set up the strategy such that at 1:59 AM, for example, an ExitLong and ExitShort are entered. Doesn't that mean the strategy recognizes the computer's clock for that value?
Comment
-
Not sure what you mean. If you want to enter a position use EnterLong/Short(). You need to choose which position you want and place the appropriate order.
ExitLong/Short() only work if you already have a long/short position. You can only be long or short. You cannot be both for the same instrument so not sure what behavior you are looking for with submitting both. Please clarify. Thank you.Josh P.NinjaTrader Customer Service
Comment
-
Sorry, I misstated. I meant can I enter an EnterLong and EnterShort on the same bar? I know this can be done using two SuperDoms, but can it be written as NinjaScript? As an example, if the current bar closes at 1.012, I want to say EnterLong at 1.025 and EnterShort at 1.000 so that if the price thereafter moves up to 1.025, the EnterLong is executed but if it, instead, moves down to 1.000, the EnterShort is executed.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Tin34, Today, 03:30 AM
|
2 responses
11 views
0 likes
|
Last Post
by Tin34
Today, 04:11 AM
|
||
Started by sastrades, Yesterday, 09:59 AM
|
2 responses
26 views
0 likes
|
Last Post Today, 04:06 AM | ||
Started by ETFVoyageur, Today, 12:52 AM
|
1 response
12 views
0 likes
|
Last Post Today, 03:36 AM | ||
Started by lollers, Today, 03:26 AM
|
0 responses
10 views
0 likes
|
Last Post
by lollers
Today, 03:26 AM
|
||
Started by aliyahany, Today, 03:16 AM
|
0 responses
2 views
0 likes
|
Last Post
by aliyahany
Today, 03:16 AM
|
Comment