Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Putting max trailing drawdown and daily loss limit directly into a trading strategy
Collapse
X
-
Putting max trailing drawdown and daily loss limit directly into a trading strategy
Would it be possible to implement something like this into the strategy itself via ninjascript? I know that it is possible to turn on a function like this for the account when live trading, but I want to be able to see the effects in the strategy analyzer when doing backtesting. Thank you in advance for any help!Tags: None
-
Hello, thanks for writing in. You can get the Drawdown value while the strategy is running using this code:
SystemPerformance.AllTrades.TradesPerformance.Curr ency.Drawdown
This comes from the documentation example here:
We have examples of a daily loss limit here:
Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader
- Likes 1
-
Thanks for the helpful response. I am attempting to use the DailyLossLimitMultiTradeExample that you sent a link to as part of my strategy. It is working fine to record losing trades as part of the currentPnL, but it sometimes misses winning trades, leading the strategy to "think" that the currentPnL situation is worse that it really is. Is there a known fix for this issue? If necessary I can provide the code for my strategy.
Comment
-
Hello PacifistZealot,
To confirm, are you able to reproduce this behavior using the DailyLossLimitMultiTradeExample without any modifications?
Are you printing the last trade information from the SystemPerformance and finding that the entry price and exit price are not matching the profit of that trade?Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
56 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
34 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
195 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
359 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
281 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
Comment