Hello, I'm currently using this custom calculation to simulate the current gross realized for a back-test since the strategy analyzer cannot take "Account.Get(AccountItem.GrossRealizedProfitLo ss, Currency.UsDollar)".
The variable "CurrentGrossRealizedPnL" should only be 0 at the beginning of the strategy then keep updating to a new value after every trade, but since I have it set to CalculateOnPriceChange it resets to 0 each time the method is called.
How can I avoid resetting the variable each time the method is called?
Comment