I am facing a problem when getting access to strategy performance (the issue happens not on all computers, however...).
Here is my code:
DateTime currentDay = new DateTime(Time[0].Year,Time[0].Month,Time[0].Day); TradeCollection currentDayTrades = null; double netProfit = 0; try{ currentDayTrades = (TradeCollection)SystemPerformance.AllTrades.ByDay[currentDay]; netProfit = currentDayTrades.TradesPerformance.NetProfit; } catch(Exception ex){ Print("Error in trades performance calculation: "+ex.ToString()); }
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(T Key key)
Best regards,
Alexei
Comment