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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
47 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
23 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
33 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
51 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment