// ighest value:
double _highestcumprofit = MAX(mycumprofit, Bars.BarsSinceSession - 1)[0];
It locks up Ninja.
I have the following:
#variables
private DataSeries mycumprofit;
#init
mycumprofit = new DataSeries(this);
#onbarupdate
if (Bars.FirstBarOfSession)
mycumprofit = new DataSeries(this); // re-init each day
mycumprofit.Set(Performance.AllTrades.TradesPerformance.Currency.CumProfit);
// then to get the highest value:
double _highestcumprofit = MAX(mycumprofit, Bars.BarsSinceSession - 1)[0];
// and to find out how many bars ago that was
int _highestcumprofit_bar = HighestBar(mycumprofit, Bars.BarsSinceSession - 1);
// and to find out the time stamp of that bar
Print(Time[_highestcumprofit_bar] + ": this was the time I made " + _highestcumprofit.ToString());

Comment