I’m using a data series like so:
if (Performance.AllTrades.Count != tradeCount) { tradeCount = Performance.AllTrades.Count; foreach (Trade x in Performance.AllTrades) { if (x.Exit.Time.Date.CompareTo(Time[0].Date) == 0) { dayPnL += x.ProfitCurrency; } } } int y = 0; dayPnL = 0; foreach (Position x in Positions) { dayPnL += x.GetProfitLoss(Closes[y][0], PerformanceUnit.Currency); y++; } intraDayPnL.Set(dayPnL); intraDayPnLList.Add(dayPnL);
double test = MAX(intraDayPnL, 200)[0]; double max = double.MinValue; double min = double.MaxValue; foreach (object item in intraDayPnLList) { if (item is double) { if ((double)item > max) { max = (double)item; } if ((double)item < min) { min = (double)item; } } } Print("The highest intra-day PnL is " + MAX(intraDayPnL, (intraDayPnL.Count - 1))[0]); Print("The lowest intra-day PnL is " + MIN(intraDayPnL, (intraDayPnL.Count - 1))[0]); Print("Highest list value " + max); Print("Highest list value " + min);
Could you please help?
Comment