for now I have a variable set before OnStateChange and when the strategy achieves a new high for gross realized pnl, I manually stop the strategy, type in the new value and compile.
how and where can I write the variable so that it automatically captures the highest realized gross pnl and have it update automatically during the strategy’s life?

Comment