Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Max daily loss
Collapse
X
-
Hello Adamel,
Thank you for your post.
We have posted an example named 'DailyLossLimitBuilderExample_NT8.zip' (on post #1) that shows how to configure a daily loss limit within the Strategy Builder:
This example will work with the Strategy Analyzer as well.
Please let us know if we may be of any further assistance.
-
Hello Adamel,
Have you been able to import the strategy (DailyLossLimitBuilder) and open it?
After importing this example strategy, you will be able to view it in the NinjaScript Editor and Strategy Builder.
The Strategy Builder Custom Series can be used with offsets to do math and subtract the total PNL from yesterdays PNL to get the current PNL.
If you haven't already imported DailyLossLimitBuilder, here is a basic guideline on how to import NinjaScript add-ons in NinjaTrader:- Download the NinjaScripts to your desktop, and keep them in the compressed .zip file.
- From the Control Center window, click Tools > Import > NinjaScript Add-on...
- Select the downloaded .zip file
- NinjaTrader will then confirm if the import has been successful.
Once the example strategy is open in the Strategy Builder, you'll see how there are two custom series (YesterdaysPNL and StrategyTotallPNL); an input and a variable, and 6 sets of conditions and actions where the PNL calculations are defined.
Please let me know if I may be of any further assistance.
Comment
-
Hello Adamel,
Thank you for your reply.
You don’t need to use the exact sets shown in the example, but the general logic can be used as a guideline for how to implement a daily loss limit.
The print and draw actions are optional.
Here is an explanation of the sets in the example:
A series is added on the Additional Data page to remember the pnl from the previous session and to do custom math.- In set 1, the values in the series are carried forward to the next bar.
- In set 2, the DailyPNL is reset to 0 for a new day of trading pnl. The previous session PnL is saved to the series.
- In set 3, the DailyPNL is set to the current total Pnl minus the previous sessions ending PnL
- In set 4, a print is added to give insight into understanding the behavior, and why the next condition will evaluate as true or false
- In set 5, are the regular conditions to enter a long trade, including a check that the DailyPnL is greater than the daily loss allowed
- In set 6, are the regular conditions to enter a short trade, including the same check the DailyPnL is greater than the daily loss
Please let me know if you have any further questions.
Comment
-
Hello Adamel,
Thank you for your reply.
Set 4 includes only a print to help determine whether the conditions in sets 5 and 6 will evaluate as true or false.
This is optional.
You are also free to customize the entry conditions in sets 5 and 6 if you would like.
Just make sure to include the part that checks that the DailyPnL is greater than the daily loss allowed
Please let me know if I may be of any further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
44 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment