Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Setting daily loss limit and actvity limit
Collapse
X
-
Setting daily loss limit and actvity limit
I am a client of Ninjatrader brokerage. Is it possible for you, the brokerage, to set a daily loss limit? And/or an activity limit on your side? For example, if I loss a certain amount of dollars in a trading day and/or have three losses in a trading day, would you be able to liquidate all my positions and prevent me from making further trades?
Tags: None
-
Hello Realiori9999,
Thank you very much for your post.
It would indeed be possible to set this up; Please reach out to brokeragesupport (at) ninjatrader (dot) com from the email address registered on your account, with the information of what daily loss limit you would like to set, they will then be able to assist you.
Of course, please also let them know should you have any further questions in this regard!
-
Thank you for your reply. I have received an email saying that the brokerage is unable to set weekly limits. They can set a daily loss limit but "this will not automatically liquidate any positions you have that go against you, it will only prevent you from opening any new positions". Are there any ways to get around this and liquidate all my positions if a loss limit is hit, for example, through a Ninja script? If possible, how to do that?Originally posted by NinjaTrader_Manfred View PostHello Realiori9999,
Thank you very much for your post.
It would indeed be possible to set this up; Please reach out to brokeragesupport (at) ninjatrader (dot) com from the email address registered on your account, with the information of what daily loss limit you would like to set, they will then be able to assist you.
Of course, please also let them know should you have any further questions in this regard!
Comment
-
Hello Realiori9999,
Thanks for your note.
Yes, it would be possible to create a NinjaScript that exits orders and prevent new trades from being made when a Daily Loss Limit is hit. It would be up to you to modify the script to implement a Weekly Loss Limit.
See the example scripts shared by my colleague Chelsea in the forum thread linked below which demonstrates programming a Daily Loss Limit in a NinjaScript strategy.
https://ninjatrader.com/support/foru...limit-examples
To close out of orders and disable the strategy, you could use the CloseStrategy method.
See this help guide page for more information about CloseStrategy and sample code: https://ninjatrader.com/support/help...sestrategy.htm
Let me know if I may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
- Likes 1
Comment
-
Thank you so much. The brokerage has already set me a daily loss limit. it wll be fine for now. I will spend the weekend understand the basic logic and modify the strategy according to my need. Thanks!
Comment
-
Thank you so much. I have used the editor to check the codes. Regrettably, I am a complete ignorant in programming. The only things I understand are those English words in the script...I have never used automatic strategy. So basically, it works like an indicator. What I need to do is to just import the strategy, add the strategy on the chart, and then choose the strategy parameters as shown in the screenshot below?Originally posted by NinjaTrader_BrandonH View PostHello Realiori9999,
Thanks for your note.
Yes, it would be possible to create a NinjaScript that exits orders and prevent new trades from being made when a Daily Loss Limit is hit. It would be up to you to modify the script to implement a Weekly Loss Limit.
See the example scripts shared by my colleague Chelsea in the forum thread linked below which demonstrates programming a Daily Loss Limit in a NinjaScript strategy.
https://ninjatrader.com/support/foru...limit-examples
To close out of orders and disable the strategy, you could use the CloseStrategy method.
See this help guide page for more information about CloseStrategy and sample code: https://ninjatrader.com/support/help...sestrategy.htm
Let me know if I may assist further.
Also, what is the difference between the "DailyLossLimitExample_NT8.zip" and "DailyLossLimitBuilderExample_NT8.zip"?
How can I modify this to have a weekly loss limit, saying for example, a weekly loss limit of $1000?
Last edited by Realiori9999; 08-12-2022, 12:48 PM.
Comment
-
Hello Realiori9999,
Thanks for your note.
"So basically, it works like an indicator. What I need to do is to just import the strategy, add the strategy on the chart, and then choose the strategy parameters as shown in the screenshot below?"
You could use the strategy by downloading it and importing it onto your platform. Then you could add the strategy to a Chart window, set your properties, and check the 'enable' checkbox in the properties section to enable the strategy.
Note that this is not a fully-functioning strategy. This script is simply a reference sample for how you could implement a Daily Loss Limit in a custom NinjaScript stratgey.
"what is the difference between the "DailyLossLimitExample_NT8.zip" and "DailyLossLimitBuilderExample_NT8.zip"?"
The difference between these two scripts is the DailyLossLimitExample script is an unlocked strategy that must be manually programmed in the NinjaScript Editor window. The DailyLossLimitBuilderExample script demonstrates how to implement a daily loss limit in a strategy created in the Strategy Builder.
"How can I modify this to have a weekly loss limit, saying for example, a weekly loss limit of $1000?"
In the example script, the currentPnL variable is reset daily at the first bar of the session. This could be seen in lines 52-54 of the DailyLossLimitExample script.
You could reset the currentPnL variable when Time[0].DayOfWeek = DayOfWeek.Sunday instead of daily at the first bar of the session. This way, the currentPnL will only reset once a week when the Day of the Week is Sunday.
Note that this would require unlocking the script from the Strategy Builder and manually programming this yourself.
See the documentation below for more information about Time[0] and DayOfWeek.
Time: https://ninjatrader.com/support/helpGuides/nt8/time.htm
DayOfWeek: https://msdn.microsoft.com/en-us/lib...(v=vs.90).aspx
Let me know if I may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
"Note that this is not a fully-functioning strategy. This script is simply a reference sample for how you could implement a Daily Loss Limit in a custom NinjaScript stratgey."
I do not use automated strategy and I always place my trade manually. So does it mean it won't work unless it is incorporated into an automated strategy? Actually I tested the strategy on a sim account with the strategy enabled. I set a loss limit of $200 but the strategy does not automatically liquidate my losing position.
Thank you so much for your explanation.
Comment
-
Hello Realiori9999,
Thanks for your note.
That is correct. This would only work if it is incorporated into a custom automated NinjaScript strategy. It cannot be implemented for manually placed trades.
Once the DailyLossLimitExample script hits its Daily Loss Limit, it simply stops placing trades. It does not close out any open or working positions that have been placed. That logic would need to be programmed into the strategy by you. Note from my previous post that this script is an example and not a fully-working automated strategy.
Also note that automated NinjaScript strategies are only able to see orders placed by that specific instance of the strategy. A NinjaScript strategy cannot see orders that are manually placed.
Let me know if I may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
62 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
40 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
21 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
23 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
51 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment