Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Exit trade after x bars
Collapse
X
-
Exit trade after x bars
I would just like the strategy to exit after x bars. I'm trying to use BarsSinceEntryExecution(), but I don't know where it goes in the code, or the arguments the function takes. The NinjaTrader 8 tutorials don't do a great job explaining how to use NinjaScript. Any help is highly appreciated. -
Hello Lumbeezl,
Thank you for your note.
I have attached 2 strategies which both use BarsSinceEntryExecution. One was written in the builder and one was written in the editor. The one written in the builder, MyCustomStrategy11, on the conditions and actions page, at the bottom you should click on Set2 for how this is used.
See the following section of our helpguide,
To Import a NinjaScript into NinjaTrader 8 do the following:
From the Control Center window select Tools -> Import-> NinjaScript...
Find the file location.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
52 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
48 views
0 likes
|
Last Post
|

Comment