There needs to be a minimum amount of time, not less than, 30 minutes, but it too must close on the hour.
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
Custom Logic for close position strategy builder
Collapse
X
-
Custom Logic for close position strategy builder
Our goal is to close positions within the hour of opening. For example; if the position opens at 9:04 AM we would require that it close by 10:00 AM. On the other hand, if a position opens at 9:55 AM, that position would close at 11:00 AM not 10:00 AM due to the shortness.
There needs to be a minimum amount of time, not less than, 30 minutes, but it too must close on the hour. -
Hello Kathir,
Thanks for your post and welcome to the Ninjatrader forums!
The strategy builder is limited in the area of working with time elements and you have a variable condition of time and then a variable condition of rounding time up. These operations are not possible in the strategy builder. They could be done directly in Ninjascript which is based on C# and you would have access to all of the time methods.
An alternative you may wish to test in the strategy builder is to use the method Bars since entry which will return the number of bars since the entry was filled. This can be found in the condition builder Misc folder. If you are using time-based bars then this would seem to be a way to ensure you have a "minimum" number of bars before exiting.Paul H.NinjaTrader Customer Service
-
Hello Kathir,
Thanks for your reply.
For the strategy builder, please see:
"How to create time filters" https://ninjatrader.com/support/help...on_builder.htm
Complete strategy builder help guide: https://ninjatrader.com/support/help...gy_builder.htm
Free live webinar training on the strategy builder (you can ask questions in the live webinar), every other Thursday (alternates with Ninjascript editor): https://ninjatrader.com/PlatformTraining
Previous recording of the strategy builder webinar: https://www.youtube.com/watch?v=HCyt...We0Nf&index=11
Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by gbourque, Today, 06:39 AM
|
2 responses
14 views
0 likes
|
Last Post
by gbourque
Today, 07:05 AM
|
||
Started by rexsole, Today, 08:39 AM
|
0 responses
4 views
0 likes
|
Last Post
by rexsole
Today, 08:39 AM
|
||
Started by trilliantrader, Yesterday, 03:01 PM
|
3 responses
30 views
0 likes
|
Last Post Today, 08:28 AM | ||
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
4 responses
26 views
0 likes
|
Last Post Today, 08:19 AM | ||
Started by Brevo, Today, 01:45 AM
|
1 response
14 views
0 likes
|
Last Post Today, 08:14 AM |
Comment