However, once I added this set to my strategy, it stops working and the other sets don't work anymore.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Can't set daily profit
Collapse
X
-
Can't set daily profit
I am trying to set a daily profit, after that stop trading; for that, I created a boolean "ContinueTrading", set it to true by default, once the daily profit reached, I set it to false.
However, once I added this set to my strategy, it stops working and the other sets don't work anymore.
Tags: None
-
Hello Harry,
Thanks for your post.
The RealizedPNL provided in the strategy builder is not a daily value, it is an accumulated value over the course of the strategy which means the historical trades made by the strategy. So if you apply the strategy to a 5-day chart then trades made over the 5 historical days are added to the realizedPNL. If you look at your chart with the strategy applied you will likely find historical trades on the first day(s) that stop when your condition has been met and then of course no further trading can occur.
It is possible to create a daily resettable PNL in the strategy builder but it is a bit elaborate. I've posted an example and explanation here: https://ninjatrader.com/support/foru...et#post1156861
Alternatively, if you want to start and stop your strategy every day and do not need historical trades, an easy workaround would be to add the condition Misc>CurrentState, Equals, Misc>State>Real time, to each set. This will prevent the strategy from performing historical trades and it will immediately be ready to place live trades and RealizedPNL will start at 0. Note that with this condition you cannot run the strategy in the strategy analyzer but you can test using PlayBack with market replay data.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
90 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
135 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
120 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
69 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment