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 NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
139 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|
Comment