thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Time Stops
Collapse
X
-
Time Stops
Looking for a clean way to integrate time stops. My strategy currently scales in every bar for 10 consecutive entries. Each one of these entries needs a time stop of maximum 15 bars. I've tried individually naming entry signals and referring to them individually after 15 bars but it is getting messy. Anyone done this already?
thanksTags: None
-
Yes, I have tried that. What i realized at that time was that there was no way around recording and keeping a list of entry signals (I use CurrentBar) and then looping through these signals to compare Bars Since Entry. Since I had to keep a list either way, I decided to use a struct with entrybar signal and exit bar signal (recorded at the time of entry). However, now that I have to keep a list of signals/positions, I also find myself having to sychronize with execution fills to remove items from the list. Order mgmt is getting messy. Ideally, if I could just loop through Positions in NT I wouldn't have to keep a list myself. Or, if I could set a time stop at the time of entry and forget about it, that would be nice.
thanks
Comment
-
That seems to do the trick quite well. Originally when I used that logic, it would exit all entries since BarsSinceEntry was referencing the earliest entry. But fixing the size on exit (instead of referencing the unique position ID), subsequent calls to BarsSinceEntry refer to the next position. This is a good workaround, although if I decided not to exit that specific position at 15 bars and extended it another 15 while the rest remained the same, this would get tricky.
In any case, thanks for the help, the code is clean and simple, much appreciated.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment