Coding a strategy and I want to stop the strategy from trading IF a specific max daily loss has been hit on the day. How would I go about doing that?
I have lifetime license so I know I can use:
Account.GetAccountItem(AccountItem.RealizedProfitL oss, NinjaTrader.Cbi.Currency.UsDollar).Value;
But that returns the "realtime" value so will not work when I backtest. Is there a way to get the cumulative running net or at least gross PnL for the "session".
For a bonus point, can it have a total of both realized AND unrealized?
Thanks!
Comment