Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
daily realized profit and loss
Collapse
X
-
daily realized profit and loss
I want to get the value of daily realized profit and loss. For example, if the loss hit $2000, then there is no new trade on that day. And this value is reset to be 0 the next day and so on. I noticed there is a function SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit. My question is: Is the begin time of the function the begin time of data series and how to implement the daily updated realized profit and loss in a strategy?Tags: None
-
Hello Playdc,
Below is a link to examples of a daily loss limit logic in a strategy.
The SystemPerformance collection does not reset, and contains all trades made by the strategy instance, including historical and real-time.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
The AccountItem.RealizedPnL does reset each day at midnight central time.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Chelsea B.NinjaTrader Customer Service
-
Hi Chelsea,
Is this the correct syntax if I want to set the daily max loss to be $3000?
lock (Account.All)
myAccount = Account.All.FirstOrDefault(a => a.Name == "Sim101");
if (myAccount.Get(AccountItem.RealizedProfitLoss, Currency.UsDollar)<-3000)
MaxLoss=true;
else
MaxLoss=false;
Another question is: Is the account in the strategy analysis "Sim101"?
Comment
-
Hello Playdc,
The syntax appears correct.
The backtest account is Backtest and initial values and properties are copied from the Sim101 account, but no orders are placed to the account in a backtest or historical.
You could choose to get information from the Sim101 account if you would like, but note your strategy backtest will not be affecting any account.Chelsea B.NinjaTrader Customer Service
Comment
-
Hello Playdc,
The account values would reset at midnight central time zone (the time zone of the NinjaTrader brokerage) if you are connected to a NinjaTrader account. This real-time, current time. Not the time of the bars processing in the strategy.
This would be the same value showing on the Accounts tab of the Control Center. It would be the same on all days of the strategy as this is not related to the strategy performance or pnl, instead its the current realized pnl value of the account.
The value you see on the accounts tab of the control center, do you see a position open on the positions tab of the control center, or executions on the executions tab of the control center?
If you were intending for the realized pnl of the strategy and not the account see the example and information I have provided in post # 2.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
55 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
132 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
73 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
49 views
0 likes
|
Last Post
|

Comment